Skip to content

[iOS] Fix for CollectionView single item horizontal alignment issue when using ItemsLayout with a Footer.#24564

Merged
PureWeen merged 6 commits into
dotnet:mainfrom
Tamilarasan-Paranthaman:fix-21728
Sep 10, 2024
Merged

[iOS] Fix for CollectionView single item horizontal alignment issue when using ItemsLayout with a Footer.#24564
PureWeen merged 6 commits into
dotnet:mainfrom
Tamilarasan-Paranthaman:fix-21728

Conversation

@Tamilarasan-Paranthaman

Copy link
Copy Markdown
Member

Root Cause:

  • We had already reset the alignment in the NeedsSingleItemHorizontalAlignmentAdjustment method when a single element was in view. However, we also considered the CollectionView's bottom content inset in that condition, which led to the issue. When a footer was set, its height was added to the bottom content inset. This value did not match the layout attributes' Frame.Top value, and preventing the alignment from being reset.

Description of Change:

  • I fixed this issue by removing the CollectionView.ContentInset.Bottom value, as the footer affects the bottom content inset. The top of the first element should align with the top of the CollectionView unless grouping is enabled.
  • Additionally, the current implementation only handles the default case; we need to adjust it based on the grouping setting. Since this issue is not related to the customer-reported case, we can log it as a separate bug and address it individually.

Issues Fixed

Fixes #21728

Screenshots

Before Issue Fix After Issue Fix

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner September 2, 2024 06:31
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Sep 2, 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 marked this pull request as draft September 2, 2024 06:42
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added platform/ios area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Sep 2, 2024
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review September 5, 2024 07:16
@jfversluis

jfversluis commented Sep 5, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen

PureWeen commented Sep 5, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen

PureWeen commented Sep 6, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/Controls/src/Core/Handlers/Items/iOS/GridViewLayout.cs
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen

Copy link
Copy Markdown
Member

Failing tests are unrelated. CI is timing out on templates tests unrelated to this PR

@PureWeen PureWeen merged commit 7d6c5a9 into dotnet:main Sep 10, 2024
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@samhouts samhouts added fixed-in-9.0.0-rc.2.24503.2 and removed fixed-in-net9.0-nightly This may be available in a nightly release! labels Oct 14, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2024
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
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.0-rc.2.24503.2 partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Collectionview itemslayout styling changes with footer

5 participants