Incorrect item displayed when window scale and layout value is greater than 100
Description
When the window scale and layout value exceeds 100%, the wrong item is displayed in the CollectionView.
Steps to Reproduce
Steps to Reproduce:
- Set the window scale and layout value to greater than 100%.
- Observe the items displayed in the
CollectionView.
Link to public reproduction project repository
No response
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
<CollectionView
BackgroundColor="White"
ItemSizingStrategy="MeasureAllItems"
ItemsSource="{Binding Photos}"
VerticalScrollBarVisibility="Always">
<CollectionView.ItemsLayout>
<GridItemsLayout
HorizontalItemSpacing="4"
Orientation="Vertical"
Span="3"
VerticalItemSpacing="4" />
</CollectionView.ItemsLayout>
</CollectionView>
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:
- CollectionView items not resizing correctly when ItemsLayout is GridItemsLayout (#21494), similarity score: 0.79
- [Windows] Wrong item size on horizontal CollectionView (#17573), similarity score: 0.74
- [Windows] Wrong item size on the first item from vertical CollectionView (#17574), similarity score: 0.72
Closed similar issues:
- [Windows] Wrong CollectionView item size using MeasureFirstItem (#4113), similarity score: 0.73
- Items in CollectionView overlaying each other on Windows (#12118), similarity score: 0.72
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
This issue has been verified using Visual Studio 17.11.0 Preview 2.1 (8.0.40 & 8.0.60). Can't be reproduced on windows platform. When I set the ratio to greater than 100%, the CollectionView still displays normally.
This issue has been verified using Visual Studio 17.11.0 Preview 2.1 (8.0.40 & 8.0.60). Can't be reproduced on windows platform. When I set the ratio to greater than 100%, the CollectionView still displays normally.
Could you please provide the code snippet you're working with?
Sample - https://github.com/gauravK996/Sample/blob/main/CollectionViewDemos.zip
=> Click on vertical grid
span set to 3 but it shows only 2 item in a row
maximizing or changing window size also flickers item numbers in a rows.
MAUI Version - 8.0.61 SR6.1 (Last version that worked well - 8.0.7)
My recommended settings for size 100%, but you can try with different sizes.
<//dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM<//dpiAware> <//dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor<//dpiAwareness>
Removing this dpi settings from platforms=>windows=> app.manifest will temporarily fix this problem.
I'm affected by this issue as well. I was about to fill out a new issue and found this one at the last minute. Here is my setup :
- Target Framework : net8.0-windows10.0.19041.0
- MAUI version : 8.0.61 SR6.1
- Visual Studio version : 17.10.4
- Scale : 125%
- OS : Windows 11
I also made a very simple repro project for this issue : https://github.com/Damus765/MauiCollectionViewIssue
Here is a video of the issue, in case what's happening is not clear enough :
https://github.com/user-attachments/assets/66057ebf-b1db-4df1-bb2e-5da13835e24f
Tested this issue using Visual Studio 17.11.0 Preview 4.0 and MAUI 9.0.0-preview.6.24327.7 I can still reproduce the issue.
Issue still present. Tested on Visual Studio 17.12.4 Microsoft.Maui.Controls Version="9.0.30"