Bug 45929 - ListView ItemTemplate do not change height based on content
Summary: ListView ItemTemplate do not change height based on content
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-10-26 16:40 UTC by Leo
Modified: 2017-06-22 15:59 UTC (History)
3 users (show)

Tags: uw, ios, ac, visibility, layout
Is this bug a regression?: ---
Last known good build:

ListView ItemTemplate do not change heihgt based on content (276.56 KB, application/x-zip-compressed)
2016-10-26 16:40 UTC, Leo

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 for Bug 45929 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Leo 2016-10-26 16:40:58 UTC
Created attachment 18235 [details]
ListView ItemTemplate do not change heihgt based on content

When a ListView has a ItemTemplate with dynamic content, the ViewCell Height do now get resized consistently:

I have a sample where inside the ViewCell I have a gray block which I show/hide from code using a IsVisible Binding.

on android it works perfectly: when the block disappear, the card resizes itself and all items bellow reposition.

on UWP the block disappear but the card size stay the same until I change the size of the window. If I scroll down enough to hide the item and back again, it show with the right size.

on iOS, I get the same behavior as UWP, when the block disappear, the ViewCell height do not change until I scroll to hide it and scroll back.
Comment 1 David Ortinau [MSFT] 2017-06-22 01:54:58 UTC
Tested against and observed the contents of the cell collapse and expand when the box visibility is toggled, however the row itself doesn't resize.

I think this may be the correct behavior. Getting confirmation before closing the issue or reconfirming.

Comment 2 David Ortinau [MSFT] 2017-06-22 15:59:48 UTC
Frame and ContentView on UWP don't change (invalidate?) their size when children change.

Putting the contents of the ViewCell in a StackLayout instead of Frame resizes the entire row giving the expected behavior.