Skip to content

[iOS] CollectionView footer sizing when source is empty - fix #28610

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 5 commits into from
Apr 2, 2025

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Mar 25, 2025

Issues Fixed

Fixes #28580

Works fine with CV2

Before After

@kubaflo kubaflo requested a review from a team as a code owner March 25, 2025 17:23
@kubaflo kubaflo requested review from rmarinho and tj-devel709 March 25, 2025 17:23
@kubaflo kubaflo self-assigned this Mar 25, 2025
@kubaflo kubaflo added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/ios community ✨ Community Contribution labels Mar 25, 2025
rmarinho
rmarinho previously approved these changes Mar 25, 2025
@rmarinho
Copy link
Member

/azp run

@rmarinho rmarinho added this to the .NET 9 SR6 milestone Mar 25, 2025
@rmarinho rmarinho moved this from Todo to Approved in MAUI SDK Ongoing Mar 25, 2025
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@github-project-automation github-project-automation bot moved this from Approved to Changes Requested in MAUI SDK Ongoing Mar 26, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Mar 26, 2025
@dotnet dotnet deleted a comment from PureWeen Mar 26, 2025
rmarinho
rmarinho previously approved these changes Mar 26, 2025
@dotnet dotnet deleted a comment from azure-pipelines bot Mar 28, 2025
Copy link
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.

small comment related with Header, I know the test already has a header so it seems the same issue doesn t apply to the header but do we know why?

@@ -218,7 +218,7 @@ void UpdateHeaderFooterPosition()
height = ItemsViewLayout.CollectionViewContentSize.Height;
}

if (_footerUIView != null && (_footerUIView.Frame.Y != height || emptyHeight > 0 || _footerUIView.Frame.Height != footerHeight))
if (_footerUIView != null && (_footerUIView.Frame.Y != height || emptyHeight > 0 || _footerUIView.Frame.Height != footerHeight || _footerUIView.Frame.Width != CollectionView.Frame.Width))
Copy link
Member

Choose a reason for hiding this comment

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

Don t we need to do something like this for the Header too on line 209 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, we should. I pushed a commit

Copy link
Member

Choose a reason for hiding this comment

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

Is there a test we can add for the code that was added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turned out that the headerView has always been reframed because of this wrong condition _headerUIView.Frame.Y != headerHeight, but it should be _headerUIView.Frame.Y != -headerHeight based on this

_headerUIView.Frame = new CoreGraphics.CGRect(0, -headerHeight, CollectionView.Frame.Width, headerHeight);

right?

@rmarinho rmarinho requested a review from jsuarezruiz March 28, 2025 10:09
@rmarinho rmarinho moved this from Changes Requested to Ready To Review in MAUI SDK Ongoing Mar 28, 2025
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen modified the milestones: .NET 9 SR6, .NET 9 SR5.1 Apr 1, 2025
@PureWeen
Copy link
Member

PureWeen commented Apr 2, 2025

  • failing test is unrelated

@PureWeen PureWeen merged commit 05999a1 into dotnet:main Apr 2, 2025
127 of 129 checks passed
@github-project-automation github-project-automation bot moved this from Ready To Review to Done in MAUI SDK Ongoing Apr 2, 2025
@PureWeen
Copy link
Member

PureWeen commented Apr 2, 2025

/backport to release/9.0.1xx-sr4

@PureWeen
Copy link
Member

PureWeen commented Apr 2, 2025

/backport to rrelease/9.0.1xx-sr5

Copy link
Contributor

github-actions bot commented Apr 2, 2025

Started backporting to release/9.0.1xx-sr4: https://github.com/dotnet/maui/actions/runs/14227718037

Copy link
Contributor

github-actions bot commented Apr 2, 2025

Started backporting to rrelease/9.0.1xx-sr5: https://github.com/dotnet/maui/actions/runs/14227720878

Copy link
Contributor

github-actions bot commented Apr 2, 2025

@PureWeen backporting to "release/9.0.1xx-sr4" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: [iOS] CollectionView footer sizing fix
.git/rebase-apply/patch:87: trailing whitespace.
</ContentPage> 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
CONFLICT (content): Merge conflict in src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [iOS] CollectionView footer sizing fix
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

github-actions bot commented Apr 2, 2025

@PureWeen an error occurred while backporting to "rrelease/9.0.1xx-sr5", please check the run log for details!

Error: The specified backport target branch "rrelease/9.0.1xx-sr5" wasn't found in the repo.

@PureWeen
Copy link
Member

PureWeen commented Apr 3, 2025

/backport to release/9.0.1xx-sr4

@PureWeen
Copy link
Member

PureWeen commented Apr 3, 2025

/backport to release/9.0.1xx-sr5

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Started backporting to release/9.0.1xx-sr4: https://github.com/dotnet/maui/actions/runs/14245620125

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Started backporting to release/9.0.1xx-sr5: https://github.com/dotnet/maui/actions/runs/14245624630

Copy link
Contributor

github-actions bot commented Apr 3, 2025

@PureWeen backporting to "release/9.0.1xx-sr4" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: [iOS] CollectionView footer sizing fix
.git/rebase-apply/patch:87: trailing whitespace.
</ContentPage> 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
CONFLICT (content): Merge conflict in src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [iOS] CollectionView footer sizing fix
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

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 platform/ios
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CollectionView footer sizing when source is empty
4 participants