Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

In release 1.3.0, why ListView uses scaledScreenSize.Height to define width?

$
0
0

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 size;
        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));
        }
        else
        {
            size = new Size(num, (Double)(itemsSource.Count * this.RowHeight));
        }
        return new SizeRequest(size, size1);
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles