dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.97k stars 1.71k forks source link

[WinUI] CollectionView GridItemsLayout Shows 6 Columns Even When Span is Set to 7, When Display Scale is Set to 125% or 150% #23684

Closed turdmaggot closed 3 weeks ago

turdmaggot commented 1 month ago

Description

In Windows, when display scale is set to 125% or 150%, CollectionView shows 6 columns even though the GridItemsLayout's span attribute is set to 7. It behaves properly when display scale is set back 100%.

Steps to Reproduce

  1. Create a CollectionView.
  2. Add GridItemsLayout as ItemsLayout. Set the following attributes:
    • Orientation="Vertical"
    • HorizontalItemSpacing="5"
    • VerticalItemSpacing="5"
    • Span="7"
  3. Add a DataTemplate as ItemTemplate, with any control. Preferrably a box with borders with 145x100 in size.
  4. Bind it to an itemsource, with about 35 items.
  5. Run the Project in Windows.
  6. Assuming that your display scale is set to 100% (by default), it should display a 7 columns and 5 rows.
  7. Change display scale by going to System/Display/Scale & Layout and look for the scale dropdown. Set it to either 125% or 150%.

Actual Result: A Grid with 6 Columns image

Expected Result: A Grid with 7 Columns image

Link to public reproduction project repository

No response

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.22621.0

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Damus765 commented 1 month ago

This appears to be a duplicate of #23233.

ninachen03 commented 1 month ago

@turdmaggot Could you provide a sample project for us to investigate it further? Looking forward to your reply!

jfversluis commented 3 weeks ago

Duplicate of #23233