Bug 57472 - Images in Grid use more space as needed
Summary: Images in Grid use more space as needed
Status: RESOLVED DUPLICATE of bug 55294
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-06-14 09:17 UTC by simon.mengelkoch
Modified: 2017-08-28 15:48 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 DUPLICATE of bug 55294

Description simon.mengelkoch 2017-06-14 09:17:15 UTC
Hi,

I encountered the buggy behavior several times. Although there is always some way around this, i think this should be fixed.

i use images in xamarin forms project and load them via ImageSource.FromResource(sourceString). If i use this ImageSource in an Image, which is embedded into some kind of layout, which sizes the image, the not-sized-direction takes space equal to the images-file-dimensions, not the actual dimensions the images uses when resized.

To make this a little more clear:

I use an image of size 1000x1000 and embed it into a grid to specifie its size relative to the screen width:

<Grid >
   <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
   </Grid.RowDefinitions>
   <Grid.ColumnDefinitions>
      <ColumnDefinition Width="2*" />
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="2*" />
   </Grid.ColumnDefinitions>
 <Image Grid.Row="1" Grid.Column="1" Source="{local:ImageResource Folder.png}" HorizontalOptions="Center" />
 <Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Text="Sample Text""/>
</Grid>

What i expect is the row with the image to take as much vertical space as it needs to display the image, with the text in the second row below it.
What actually happens is, the row with the image takes 1000 vertical space because the images original height was 1000.
Comment 1 Jimmy [MSFT] 2017-06-14 21:29:07 UTC

*** This bug has been marked as a duplicate of bug 55294 ***