Bug 41162 - Сhange of height content grid while Image scale="ScaleFit"
Summary: Сhange of height content grid while Image scale="ScaleFit"
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.2.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Paul DiPietro [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-05-18 18:31 UTC by Alex
Modified: 2017-06-19 17:49 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Alex 2016-05-18 18:31:36 UTC
For example:
<Grid x:Name="rootGrid" BackgroundColor="#0e2142" ColumnSpacing="5">
    <Grid.RowDefinitions>
        <RowDefinition Height="auto" />
	<RowDefinition Height="auto" />
    </Grid.RowDefinitions>

    <Image Grid.Row="0" x:Name="imageHeader" HorizontalOptions="Fill" Aspect="AspectFit" Source="header.png" />

</Grid>

In result picture in Image will be less (reduced height), but Row[0] height remains the same. Grid Row which contains an image not resize when image resize from Aspect="AspectFit".

Sorry for my English, I tried. I hope I have understood
Comment 1 Alex 2016-05-18 18:33:12 UTC
I helped fix this following code:

imageHeader.SizeChanged += (object sender, EventArgs e) => {
				if(((Image)sender).Height>5)
					rootGrid.RowDefinitions[0].Height = ((Image)sender).Height;
			};
Comment 2 Paul DiPietro [MSFT] 2016-07-13 05:28:55 UTC
If there is still an issue for you, could you put together a reproduction project? It would help in investigating and finding a solution.
Comment 3 Paul DiPietro [MSFT] 2017-06-19 17:49:42 UTC
This issue will be closed due to a lack of response as we will assume this is no longer an issue. Please reopen this and attach a minimized reproduction project if the issue still exists as of the latest prerelease or nightly build.

Thanks!