Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 52979 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
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 20092 [details]
On iOS, ListView does not fill the available height when:
* ListView is located inside nested StackLayout
* RowHeight is set to non-zero value
* ItemSource is set
I find this behavior unexpected, because ListView will fill the available height when one of the conditions is not met (e.g. no item source, row height not used, only one StackLayout).
ListView will use the height required for the items, even zero height if the item source collection is empty. In the attached example, I expected the ListView (blue background color) to fill the complete window. It does not, thus the background color of the StackLayout is visible. When not setting RowHeight in the example, ListView fills the complete window, as expected.
I've reproduced this with:
* Xamarin.Forms 22.214.171.124
* Xamarin.Forms 126.96.36.199
* iOS 9.3
A workaround for this is to set a large enough HeightRequest (e.g. larger than window height, or just a very large number). The fill layout options seems to shrink this down to just the available height, which leads to the desired behavior in the end.
Created attachment 20122 [details]
I am able to reproduce this with the project I am attaching. It seems to affect all platforms I am confirming this report so the engineering team can investigate further.
### Steps to Reproduce
1. Run the attached repro project
### Expected Results
The ListView height will fill the rest of the page. In MainPage.xaml.cs, comment out line 21 to see the expected result.
As mentioned in the description, this doesn't happen when the ListView is outside the nested StackLayout, regardless of RowHeight being set or not. You can test this by uncommenting line 12 in MainPage.xaml.
### Actual Results
The ListView height does not fill the page.
### Version Info
Tested with Forms 188.8.131.52