Bug 45327 - ListView Header disappears when items are added on iOS
Summary: ListView Header disappears when items are added on iOS
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-12 16:31 UTC by Owen Pellegrin
Modified: 2018-03-12 22:04 UTC (History)
5 users (show)

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


Attachments
Example project that reproduces the bug. (53.92 KB, application/zip)
2016-10-12 16:31 UTC, Owen Pellegrin
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 ANSWERED

Description Owen Pellegrin 2016-10-12 16:31:21 UTC
Created attachment 18002 [details]
Example project that reproduces the bug.

Sometimes, when you add or remove items from a ListView, the Header element is given an incorrect size and disappears. I'm not exactly sure what sequence of events causes it, but I have attached a project that reproduces based on the UI in my project.

The project represents a page that is performing some long operation that will produce a set of items for the ListView. In preparation, the Header element of the ListView is set up. A 3-second Task inside the RouteDetailsView constructor simulates the completion of that long-running task and population of items. When the items are populated, the header disappears.

I've done some debugging via Immediate/Watch and discovered the Label in the header is being given a Height of -1. I've confirmed this with Label-derived classes that override OnSizeAllocated(). My understanding is you should NEVER pass a -1 for any size parameter in XF layout, so something's probably going haywire in the renderer for the ListView. 

This is an iOS-specific bug I have witnessed on 9.3.4 and iOS 10 devices and simulators. It does not reproduce in any Android cases I tried. I'm using Xamarin Studio 6.1.1 with Xamarin.iOS 10.0.1.10. I first experienced the bug in Xamairn.Forms 2.1.0.6524, but I have also reproduced it in 2.3.2.127.
Comment 1 Paul Brenner 2018-03-12 20:17:48 UTC
See https://github.com/xamarin/Xamarin.Forms/issues/2084
Comment 2 Samantha Houts [MSFT] 2018-03-12 22:04:21 UTC
Please follow the issue on GitHub for updates. Thank you.