CollectionView2 Layout Misalignment in GridItemsLayout with Horizontal Orientation on iOS and Catalyst
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
When using CollectionView2 with a GridItemsLayout and Orientation="Horizontal", the layout is not properly arranged. The header text appears misaligned and stretched, while the items are not correctly arranged. However, when using CollectionView1, the layout renders correctly.
-Using CollectionView1
https://github.com/user-attachments/assets/284646c3-10bd-41e9-9333-739499037147
- Using CollectionView2
https://github.com/user-attachments/assets/a4659173-be9a-4b1d-9dd2-dbfd6e4de447
### Steps to Reproduce
1. Launch the HostApp on iOS and Catalyst https://github.com/dotnet/maui/blob/main/src/Controls/tests/TestCases.HostApp/Elements/CollectionView/HeaderFooterGalleries/HeaderFooterGridHorizontal.xaml
2. Use CollectionView2 with a GridItemsLayout (Span=3, Orientation=Horizontal).
3. Observe that the header, footer, and items are misaligned.
Expected Behavior:
The header, footer, and items should be arranged correctly, as seen in CollectionView1.
Actual Behavior:
- Header text is stretched and misaligned.
- Footer does not align correctly with the content.
### Link to public reproduction project repository
_No response_
### Version with bug
9.0.40 SR4
### Is this a regression from previous behavior?
Not sure, did not test other versions
### Last version that worked well
_No response_
### Affected platforms
iOS, macOS
### Affected platform versions
_No response_
### Did you find any workaround?
_No response_
### Relevant log output
```shell
```
Contributor guide
Research direction
Start with src/Controls/tests/TestCases.HostApp/Elements/CollectionView/HeaderFooterGalleries/HeaderFooterGridHorizontal.xaml and run the HostApp reproduction on iOS and Catalyst. Compare the CollectionView2 GridItemsLayout case with CollectionView1 using Span=3 and Horizontal orientation. Done means the header, footer, and items align correctly on both affected platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, ios, macos
- Domain
- desktop-dev, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100