-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fix pushing same page as a modal on iOS13 in split mode #12871
Conversation
@@ -49,9 +49,6 @@ internal ModalWrapper(IVisualElementRenderer modal) | |||
PresentationController.Delegate = this; | |||
|
|||
((Page)modal.Element).PropertyChanged += OnModalPagePropertyChanged; | |||
|
|||
if (Forms.IsiOS13OrNewer) |
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.
this was duplicated
modalWrapper.Dispose(); | ||
} | ||
#endif | ||
renderer.NativeView.RemoveFromSuperview(); | ||
renderer.Dispose(); | ||
//reset layout size so we can re-layout the layer if we are reusing the same page. | ||
//fixes a issue on split apps on iPad and iOS13 | ||
visualElement.Layout(new Rectangle(0, 0, -1, -1)); |
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.
The fix is here.
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.
@rmarinho curious your thoughts on this approach.
https://github.com/xamarin/Xamarin.Forms/compare/fix-8988-shane
There might be a better fix is inside VisualElementPackager
Setting the layout bounds to -1 was causing some extra code in VEP to run that basically would set the frame back to the Element bounds. The other curiosity here is why iOS keeps wanting to set the PageContainer.Frame to 526 unprompted :-/ Finding and fixing that might also be a preferred approach though that might just be the SplitView being quirky
@PureWeen just tested, and yeah looks a better fix |
Description of Change
There's a issue on iOS13 that pushing a modal using your app in split mode, (side by side with other app), it causes issues rendering the second time.
The particular issue is also related with retaining the pushed page , it keeps it's bounds, and we need to force the layout.
Workaround could be to just reset is bounds when is popped.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Testing Procedure
Go to Issue8988 , click Next, check the page loaded, click Go Back, then click again Next and make sure the page loads fine.
PR Checklist