-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
CollectionView Items display issue when Header is resized on iOS - UI-Test #21812
base: main
Are you sure you want to change the base?
Conversation
@@ -46,6 +46,16 @@ protected override void Dispose(bool disposing) | |||
_footerViewFormsElement.MeasureInvalidated -= OnFormsElementMeasureInvalidated; | |||
} | |||
|
|||
if (_headerUIView is MauiView hv) | |||
{ | |||
hv.LayoutChanged += HeaderView_LayoutChanged; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you subscribe to SizeChanged on the header/footer xplat elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I try to do the following:
_headerViewFormsElement.SizeChanged += _headerViewFormsElement_SizeChanged;
_headerViewFormsElement_SizeChanged
never triggers
src/Controls/src/Core/Handlers/Items/iOS/StructuredItemsViewController.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just wondering about the fact that now we have 2 events that are triggering the layout code when the first did not work. Is there a reason for both?
if (_headerUIView is MauiView hv) | ||
{ | ||
hv.LayoutChanged -= HeaderViewLayoutChanged; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are now watching the actual method that is doing layout, do we still need the original _footerViewFormsElement.MeasureInvalidated
? The code seems to end up calling the same HandleFormsElementMeasureInvalidated
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IS grabbing the element for footer and header not the all view right? some still need for each one .
@@ -134,6 +134,7 @@ public override void LayoutSubviews() | |||
} | |||
|
|||
CrossPlatformArrange(bounds); | |||
OnLayoutChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be renamed to match the method. Also, no need to have the method, just invoke the event directly. Maybe use a name of ArrangingSubviews
or even just OnLayoutSubviews
since it is internal. I see MovedToWindow
got away with the same name because it was an explicit interface member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to invoke the event directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should revisit if this is needed once we test on net9 with CollectionViewHandler2 and once we merge this PR #23052
/rebase |
e8da440
to
718e416
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@kubaflo Could you rebase and fix the conflicts? Thanks in advance. |
@jsuarezruiz Rui has cherry-picked commits from this PR to this PR: #25157 But I think we can keep the UT test in this PR. What do you think? If, so then we will need to change the iOS screenshot, because it will probably fail because of dimensions |
Issues Fixed
Fixes #20538
Fixes #12429
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-13.at.17.21.10.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-13.at.17.17.05.mp4