Bug 25148 - iOS: rendering-height to Image in Listview is calculated wrong
Summary: iOS: rendering-height to Image in Listview is calculated wrong
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-08 08:23 UTC by Fredy Wenger
Modified: 2016-04-24 18:12 UTC (History)
6 users (show)

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


Attachments
Details to bug (2.58 MB, application/pdf)
2014-12-08 08:23 UTC, Fredy Wenger
Details
See comment (283.56 KB, application/pdf)
2015-01-07 11:48 UTC, Fredy Wenger
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 Fredy Wenger 2014-12-08 08:23:51 UTC
Created attachment 8997 [details]
Details to bug

I have sent a mail with a dropbox download-link to bugzilla@xamarin.com at 11.18.
The name of the app is MatrixGuide.
I will now upload various bug-description's related to the app (you should be able to comprehend, if you install the app).
Each .pdf also contains a short description, how to serve the app and detailed information's to my SW-versions.
Comment 1 Atin 2015-01-05 08:48:01 UTC
Hi Fredy, 

I have checked and review the details to bug in attached pdf provided in bug description and it is awesome information about the issue. But I am not able to access the dropbox downloaded-link due to authentication regarding bugzilla@xamarin.com. Could you please provide us the dropbox downloaded-link for sample application here, in bug description. That would be very helpful to reproduce/investigate this issue at our end.

Thanks
Comment 2 Fredy Wenger 2015-01-05 08:52:27 UTC
Download-Link: 
https://www.dropbox.com/s/qmm4tyv8g2nej27/MatrixGuide_App.zip?dl=0

Please let me know, if you were able to download.
Comment 3 Atin 2015-01-06 13:27:16 UTC
@Fredy, thanks a lot, For providing the dropbox downloaded-link for sample application. I am successfully able to download the sample application "MatrixGuide". But when I try to build the application I am getting the following building error: https://gist.github.com/Rajneesh360Logica/b198cd67f14f8dc1cd26

Screencast: http://www.screencast.com/t/b2pjfPEsD

I try to to remove this error, but unfortunately not able to do so. Could you please let me know know that how to remove this error or if possible please provide me another link for the sample application that has no build error. Please let me know if I am missing anything ?

Environment info:

Xamarin.Forms 1.3.0.6275-per1

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02381
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02381
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02381
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02381
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02381
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02381
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02381
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446016-02381
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.3.50717.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.20703.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.2
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure Mobile Services Tools   1.2
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.2
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.8.150.0 (10cfd178d55287f09c85f5a1e604dfe20889a40f)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.28 (ba9bbbdd44cfdc4bf485e8885bd2ad24fba525f7)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (840a925103a0bf4a856507f13d5eaee3c1579c2f)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 4 Fredy Wenger 2015-01-06 13:41:05 UTC
Hy Atin.
I have submitted the app also to other supporters - they where able to compile.
As your video shows, at least the xamarin.mobile package is missing.
Maybe also the xamarin.maps-package.
Both are Xamarin NuGets. 

Try he following:
Select the top level project-root in the project-explorer (on the right side)
Right-click and select NuGet
See what happens...
If xamarin.mobile and xamarin.maps are not in the list, install it from NuGet.
Comment 5 Atin 2015-01-07 10:01:06 UTC
Thanks a lot, Fredy.
I try this issue again on different machines as per you instruction provided in comment 4. I have installed Xamarin.Forms.Maps and Xamarin.Mobile packages, but still facing the same behavior. 
Screencast: http://www.screencast.com/t/JaUbAOvID

I observed that Xamarin.Forms.Maps and Xamarin.Mobile packages are installed but the error still showing that Nuget packages are missing.
Error: https://gist.github.com/Rajneesh360Logica/9ba80bab312189e612cd

Please let me know what I am missing to reproduce this issue Or I have to follow any other steps to reproduce this ?
Comment 6 Fredy Wenger 2015-01-07 11:47:55 UTC
Hi Atin
See attachment...
Comment 7 Fredy Wenger 2015-01-07 11:48:38 UTC
Created attachment 9270 [details]
See comment
Comment 8 Ram Chandra 2015-01-08 13:44:39 UTC
I have checked this issue and with the help of attached sample I am able to reproduce this behavior.

I have checked this issue on device and simulator and observed that if
the width of WidthRequest do not fit in the available space the height of an image in a ListView is calculated wrong. I have checked this issue on device (iPhone 4s 8.2) and simulator and getting the same behavior on both device and simulator.

Screencast: http://www.screencast.com/t/i5P5IBkbEf

IDE logs: https://gist.github.com/RamChBachkheti/7ad6ac62fcd057ac9944
MTBS server logs: https://gist.github.com/Rajneesh360Logica/d91f8a60cdc7c343fdcb

Please let me know if I can provide any other info.

Environment Info:

Mac Info: 
Mac OS X 10.9.5
Xamarin Studio: 5.7 (build 661)
Mono 3.12.0 ((detached/1538a59)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000072
Xcode 6.1 (6604)
Build 6A1052d
Xamarin.iOS: 8.6.0.50 (Business Edition)
=== Build Information ===
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

Windows Info: 

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   3.9.236.0 (d6a2cae)
Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Xamarin.iOS Unified Migration   1.0
Comment 9 Fredy Wenger 2015-01-08 14:02:03 UTC
Thanks, Ram...
Comment 10 Jason Smith [MSFT] 2015-01-14 18:31:21 UTC
The final solution to ListView measurement will be given in a later release. However it will not be automatic as this bug report expects. There is another way to empower the user to perform the expensive measurement call if they really want this to happen in this fashion by providing a way to estimate sizes of unrealized Views (this will be as slow as doing it normally is).

That said, we are not going to build this in as an automatic behavior.
Comment 11 dpedrinha 2016-04-24 18:12:15 UTC
Wouldn't something simple as adding the following code to ChildAdded and ChildRemoved event handlers of AbsoluteLayout fix it?

    double neededHeight = 0;
    foreach(var child in sender) {
        if(neededHeight < child.Y+child.Height) {
            neededHeight = child.Y+child.Height;
        }
    }
    sender.HeightRequest = neededHeight;