Bug 24005 - Grid View holding resized image incorrectly uses default image height instead of scaled image height
Summary: Grid View holding resized image incorrectly uses default image height instead...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-10-22 19:10 UTC by Kent Green [MSFT]
Modified: 2016-06-03 17:41 UTC (History)
7 users (show)

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


Attachments
Project demonstrating the bug (48.36 KB, application/zip)
2014-10-22 19:10 UTC, Kent Green [MSFT]
Details
repro project (100.05 KB, application/zip)
2015-12-15 23:00 UTC, Jimmy [MSFT]
Details


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 NOT_ON_ROADMAP

Description Kent Green [MSFT] 2014-10-22 19:10:59 UTC
Created attachment 8476 [details]
Project demonstrating the bug

--Overview--
From this desk case:
https://xamarin.desk.com/agent/case/94405

Also from this forum post (same customer):
http://forums.xamarin.com/discussion/26321/grid-cell-with-image-content-height-is-set-to-that-of-not-scaled-image

The customer reports that when trying to use a Grid in their app the cell incorrectly places the image based on the original height value rather than the rescaled value. I showed Jason this issue so he could see it. 

---Expected Behavior---
The expected behavior is that the height should be based on the rescaled image value. 

---Actual Behavior---
I am able to reproduce the error, I've attached a buildable test case as a sample; also, the primary XAML code to reproduce this issue is shown below:

<Grid Padding="10" BackgroundColor="#8f00">
	
	<Grid.ColumnDefinitions>
		<ColumnDefinition Width="1*" />
		<ColumnDefinition Width="3*" />
	</Grid.ColumnDefinitions>

	<Grid.RowDefinitions>
		<RowDefinition Height="Auto" />
		<RowDefinition Height="Auto" />
		<RowDefinition Height="Auto" />
	</Grid.RowDefinitions>

> <Image Grid.Row="0" Grid.Column="0" Source="waterfront.jpg" Aspect="AspectFit" BackgroundColor="#008" />

---Build information---
Xamarin.Forms 1.2.3.6257

=== Xamarin Studio ===
Version 5.5.2 (build 3)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin.iOS ===

Version: 8.4.0.14 (Business Edition)
Hash: 1d464a1
Branch: 
Build date: 2014-10-17 21:50:07-0400

=== Build Information ===

Release ID: 505020003
Git revision: 6d4c806e383ba366b15fbccca9ddc1ba94f8d5ad
Build date: 2014-10-15 15:00:36-04
Xamarin addins: 069ddd29bb70a42238142eee9bac21a5e4b2f9f9

=== Operating System ===

Mac OS X 10.10.0
Darwin Kents-MacBook-Pro.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 1 Danish Akhtar 2014-10-27 11:22:56 UTC
I have checked this issue with the help of sample app provided in bug description and below are my observations.

1. If we increase the number of labels which combined height is larger then the image height then then image height is not getting increased automatically(Image size remains to it's default size).

2. Image is not displaying when we run the app on iOS simulator  and when we run the app on XAP(Nexus 4 (Jelly Bean) image is displaying.

Screencast : http://www.screencast.com/t/3xYGZZm0

Please let me know if I have missed anything or have to check something else to reproduce this issue.

Environment Info :

Xamarin.Forms version  : 1.2.3.6257

=== Xamarin Studio ===

Version 5.5.2 (build 3)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Runtime:
	Mono 3.10.0 ((detached/e204655)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000023

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.iOS ===

Version: 8.4.0.15 (Business Edition)
Hash: 08968c4
Branch: 
Build date: 2014-10-20 21:48:06-0400

=== Xamarin.Mac ===

Version: 1.10.0.13 (Business Edition)

=== Xamarin.Android ===

Version: 4.18.0 (Business Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6    (API level 4)
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.0    (API level 11)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Build Information ===

Release ID: 505020003
Git revision: 6d4c806e383ba366b15fbccca9ddc1ba94f8d5ad
Build date: 2014-10-15 15:00:36-04
Xamarin addins: 069ddd29bb70a42238142eee9bac21a5e4b2f9f9

=== Operating System ===

Mac OS X 10.9.4
Darwin Xamarin76s-Mac-mini.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 3 Jimmy [MSFT] 2015-12-15 23:00:11 UTC
Created attachment 14306 [details]
repro project

This issue is still present in Forms 2.0+. I've attached an updated sample that reproduces the issue.

### Expected Results
The red BoxView is placed directly below the row of images.


### Actual Results
The width of the images is resized correctly to fit the width of the screen. However, the Grid's height is not resized to the scaled image's height even though the Grid row's height is set to "Auto". This results in what looks like a lot of padding between the images and the BoxView below.

I've added a background color to one of the images to demonstrate that the image's height is not scaled.
Comment 4 Jimmy [MSFT] 2015-12-15 23:01:55 UTC
Marking as CONFIRMED since I can also reproduce the issue with the updated project attached in comment #3.
Comment 5 Jason Smith [MSFT] 2016-06-03 17:41:11 UTC
This would require a behavior change which is incompatible with our current backwards compatibility stance.