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 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.
In class Xamarin.Forms.ListView.cs (Xamarin.Forms.Core.dll portable version), there is a new override in 1.3.0,
protected override SizeRequest OnSizeRequest(Double widthConstraint, Double heightConstraint).
Should the line of code Double num = Math.Min(width, scaledScreenSize.Height) be Double num = Math.Min(width, scaledScreenSize.Width).
The scaledScreenSize.Height is used instead of scaledScreenSize.Width.
protected override SizeRequest OnSizeRequest(Double widthConstraint, Double heightConstraint)
Size size1 = new Size(40, 40);
Double width = Device.Info.ScaledScreenSize.Width;
Size scaledScreenSize = Device.Info.ScaledScreenSize;
Double num = Math.Min(width, scaledScreenSize.Height);
IList itemsSource = base.ItemsSource as IList;
if (itemsSource == null || this.HasUnevenRows || this.RowHeight <= 0 || this.IsGroupingEnabled)
Double width1 = Device.Info.ScaledScreenSize.Width;
Size scaledScreenSize1 = Device.Info.ScaledScreenSize;
size = new Size(num, Math.Max(width1, scaledScreenSize1.Height));
size = new Size(num, (Double)(itemsSource.Count * this.RowHeight));
return new SizeRequest(size, size1);
I have checked this issue and observed that when we implement the code given in bug description in an app, then we are getting option 'scaledScreenSize.Height' to define width along with option 'scaledScreenSize.Width' in auto completion window.
Screencast : http://www.screencast.com/t/agjTvqyKSsj3
@Chen, Please let me know if I have to check something else to confirm this issue. Thanks!
Environmet Info :
Xamarin.Forms : 1.3.0
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Xamarin 22.214.171.124 (a6d269d)
The code given in the bug description is not my code, it is from the code released by Xamarin Form 1.3.0. Since I don't have the access to Device.Info, it is internal static, I cannot override this method as I want to use scaledScreenSize.Width.
@Chen, if possible I think ideally the Xamarin QA team and the Xamarin.Forms team would love to get a simple complete Xamarin.Forms app that demonstrates a problem with the size of ListView as an attachment on this bug report. Perhaps nesting the sample ListView from  in some specific Page structure that imitates your full app would be sufficient?
>  https://github.com/xamarin/xamarin-forms-samples/blob/master/FormsGallery/FormsGallery/FormsGallery/ListViewDemoPage.cs
Thanks in advance for any sample app you might be able to provide!
I'm a member of the Support team rather than the Xamarin.Forms team, so at first glance, I'm not sure of the intention behind the use of `Math.Min(Device.Info.ScaledScreenSize.Width, Device.Info.ScaledScreenSize.Height)` as the width of the size request. In general I would not recommend guessing at the intention behind decompiled code. That said, switching the code as suggested in comment 0 would be equivalent to:
> Double num = Math.Min(Device.Info.ScaledScreenSize.Width, Device.Info.ScaledScreenSize.Width);
... which is in turn equivalent to:
> Double num = Device.Info.ScaledScreenSize.Width;
So I suspect there is an explanation for the use of `Math.Min()` to pick between the Width vs. the Height. Otherwise the developers would have just used `Device.Info.ScaledScreenSize.Width` directly. Still, the current code is puzzling. It sort of looks like the intention is that the ListView should always be oriented such that the horizontal axis is along the shorter axis of the display, but that is clearly not how the ListView works in practice.
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d
Xamarin Forms Team