dotnet / dotnet/maui

CollectionView2 Layout Misalignment in GridItemsLayout with Horizontal Orientation on iOS and Catalyst

Open
#28,030 1 comment 0 reactions 0 assignees View on GitHub
area-controls-collectionview collectionview-cv2 i/regression p/0 partner/syncfusion regressed-in-9.0.0 s/triaged s/verified t/bug
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.