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
22.24k stars 1.76k forks source link

[IOS] CollectionView with HorizontalGrid Layout did not align single item properly. #25181

Open NirmalKumarYuvaraj opened 1 month ago

NirmalKumarYuvaraj commented 1 month ago

Description

The CollectionView with a horizontal grid layout does not arrange the first child at the start position. Instead, it places the child in the center.

Steps to Reproduce

  1. Run the attached sample.
  2. if only one item is present , it is placed in center.
  3. Added another item, then the child is arranged properly.

Link to public reproduction project repository

https://github.com/NirmalKumarYuvaraj/MauiIssues/tree/CVSingleItemVerticalAlignmentIssue

Version with bug

8.0.82 SR8.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Image

Android IOS

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

IOS

Did you find any workaround?

No response

Relevant log output

No response

jaosnz-rep commented 1 month ago

This issue can't be reproduced at iOS platform on the latest 17.11.5(8.0.91 & 8.0.82).

NirmalKumarYuvaraj commented 1 month ago

I can reproduce this issue in IOS (8.0.91). I have simplified my sample and attached the image of Android and iOS behaviors for your reference. Image

jaosnz-rep commented 1 month ago

@NirmalKumarYuvaraj I deployed the project to iOS and it only showed a blank page.What did I miss? Image

NirmalKumarYuvaraj commented 1 month ago

@jaosnz-rep , I was able to reproduce the issue in this sample. Could you please check this sample? MauiIssues-CVSingleItemVerticalAlignmentIssue.zip