Skip to content

[iOS] Fix for CollectionView with horizontal grid layout has extra space on right end #25825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman commented Nov 13, 2024

Root Cause of the issue

  • The HorizontalItemSpacing was being applied from the GetInsetForSection method, even though it was not a grouped collection

Description of Change

  • The HorizontalItemSpacing should not be applied from the GetInsetForSection method when it is not a grouped collection. Therefore, I set the return value to zero, which resolves the issue.

Note

  • Unfortunately, I was not able to validate the issue fix in CollectionView2 using HorizontalOptions set to center, as it seems the collection view occupies the entire width in CV2. For now, I have used CollectionView1 in the test sample since I have fixed the issue in CollectionView1.

Issues Fixed

Fixes #25433

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

  • Note: I have set the CollectionView background color to red to make the differences more visually apparent. The red areas in the image represent the spaces.

1. Without Grouping:

Before Issue Fix After Issue Fix

2. With Grouping

Before Issue Fix After Issue Fix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 13, 2024
Copy link
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 Nov 13, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -0,0 +1,26 @@
#if !MACCATALYST || !WINDOWS
Copy link
Contributor

Choose a reason for hiding this comment

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

VerifyScreenshot is not implemented on Catalyst yet. Should not be necessary to avoid in that platform.
Why avoid it on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz, It seems that item spacing on the Windows platform is still not functioning correctly, so I am skipping the Windows platform for now. For your reference, I have attached the related issue report #11320. How can we proceed with this? Please share your thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you include a comment in code with a reference to the issue #11320?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz, I have added a comment. Could you please check and provide your concerns if any?

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review November 18, 2024 09:58
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner November 18, 2024 09:58
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho merged commit b03cb7e into dotnet:main Dec 5, 2024
108 checks passed
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@samhouts samhouts added fixed-in-9.0.21 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
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-9.0.21 fixed-in-net8.0-nightly This may be available in a nightly release! partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collection view with horizontal grid layout has extra space on right (end) of collection
5 participants