Skip to content

[iOS] Fix for Single item alignment issue in CollectionView HorizontalGrid Layout#25370

Merged
rmarinho merged 7 commits intodotnet:mainfrom
Tamilarasan-Paranthaman:fix-25181
Dec 12, 2024
Merged

[iOS] Fix for Single item alignment issue in CollectionView HorizontalGrid Layout#25370
rmarinho merged 7 commits intodotnet:mainfrom
Tamilarasan-Paranthaman:fix-25181

Conversation

@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member

Root Cause of the issue

The CollectionView seems to centre the item if only one exists. We had already adjusted the HorizontalAlignment for the VerticalGrid layout when a single element was in view. However, we missed making the same adjustment for the HorizontalGrid layout.

Description of Change

I have applied the same adjustment to the horizontal grid layout as was done for the vertical grid layout.

Issues Fixed

Fixes #25181

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 18, 2024
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Oct 18, 2024
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman changed the title Fixed 25181. [iOS] Fix for Single item alignment issue in CollectionView HorizontalGrid Layout. Oct 18, 2024
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman changed the title [iOS] Fix for Single item alignment issue in CollectionView HorizontalGrid Layout. [iOS] Fix for Single item alignment issue in CollectionView HorizontalGrid Layout Oct 18, 2024
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review October 22, 2024 10:38
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner October 22, 2024 10:38
@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member Author

/rebase

@github-actions github-actions bot force-pushed the fix-25181 branch 2 times, most recently from 5929285 to 3e94697 Compare October 22, 2024 21:56
@PureWeen
Copy link
Copy Markdown
Member

/rebase

Copy link
Copy Markdown
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SingleItemAlignmentInCollectionViewHorizontalGridLayout is failing

@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member Author

SingleItemAlignmentInCollectionViewHorizontalGridLayout is failing

@PureWeen, I added this test for this issue. There seems to be a slight difference between the previously committed image and the current one generated by the CI. However, the current image is correct, so I have committed it.

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 Servicing milestone Oct 31, 2024
@sheiksyedm
Copy link
Copy Markdown
Contributor

/rebase

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
rmarinho
rmarinho previously approved these changes Dec 10, 2024
@rmarinho rmarinho requested a review from PureWeen December 10, 2024 10:07
@rmarinho
Copy link
Copy Markdown
Member

/rebase

@rmarinho rmarinho self-assigned this Dec 11, 2024
@rmarinho rmarinho modified the milestones: .NET 9 Servicing, .NET 9 SR3 Dec 11, 2024
@dotnet dotnet deleted a comment from PureWeen Dec 11, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot Dec 11, 2024
@dotnet dotnet deleted a comment from jsuarezruiz Dec 11, 2024
@dotnet dotnet deleted a comment from PureWeen Dec 11, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot Dec 11, 2024
@dotnet dotnet deleted a comment from jsuarezruiz Dec 11, 2024
@rmarinho
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is failing for CV1 seems the layout is expanding below the status bar and we cut that off for the test ? or do we need to regenerate images?

image

Original screenshot full screen

image

@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member Author

The test is failing for CV1 seems the layout is expanding below the status bar and we cut that off for the test ? or do we need to regenerate images?

image

Original screenshot full screen

image

@rmarinho, Yes, it is expanding below the status bar, and it seems the CI did not account for that space. I have modified the test sample to address this by wrapping the CollectionView in a StackLayout, and it now passes both CV1 and CV2 on my end. Could you please review it and let me know if you have any concerns?

@rmarinho
Copy link
Copy Markdown
Member

Nop wrapping a CollectionView on a StackLayout is not a good practice. Try use a Grid instead.

@Tamilarasan-Paranthaman
Copy link
Copy Markdown
Member Author

Nop wrapping a CollectionView on a StackLayout is not a good practice. Try use a Grid instead.

@rmarinho, thank you for pointing this out! I have replaced the StackLayout with a Grid as suggested, and it worked as expected during my testing. Could you please check and let me know if you have any further concerns?

@rmarinho
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho merged commit 033e5b8 into dotnet:main Dec 12, 2024
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman deleted the fix-25181 branch June 16, 2025 11:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-net9.0-nightly This may be available in a nightly release! partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

6 participants