-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix for First Item in CollectionView Overlaps in FlyoutPage.Flyout on iOS #29265
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
base: main
Are you sure you want to change the base?
Fix for First Item in CollectionView Overlaps in FlyoutPage.Flyout on iOS #29265
Conversation
Hey there @@praveenkumarkarunanithi! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
[Test] | ||
[Category(UITestCategories.FlyoutPage)] | ||
public void CollectionViewFirstItemShouldNotOverlapWithSafeAreaInFlyoutMenu() |
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 test is failing on iOS:
CollectionView Y position should be at least 69 to avoid overlapping with safe area
Assert.That(App.WaitForElement("CollectionView").GetRect().Y, Is.GreaterThanOrEqualTo(69))
Expected: greater than or equal to 69
But was: 54
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.
@jsuarezruiz , now the test case has been updated with proper assert conditions that correctly verify safe area respecting behavior on iOS devices.
Root Cause
On iOS devices with notches (iPhone X and newer), the FlyoutPage.Flyout content was rendering beneath the status bar because
PhoneFlyoutPageRenderer
ignored safe area insets and positioned the flyout. Although individual ContentPages honor safe areas when ios:Page.UseSafeArea is true, the Flyout container did not.Description of Change
The fix checks whether the FlyoutPage implements
ISafeAreaView
and respects the safe area settings. Ifios:Page.UseSafeArea
is enabled and the platform is iOS 11 or higher, the Flyout container’s frame is adjusted by shifting its Y origin to match the top safe area inset and reducing its height accordingly. This ensures that all child content, including CollectionView and other controls, render below the notch or status bar.To apply this fix effectively, developers must explicitly set
ios:Page.UseSafeArea="true"
on the FlyoutPage, as theUseSafeArea property
defaults to false for FlyoutPage.Issues Fixed
Fixes #29170
Tested the behaviour in the following platforms
Note
This issue is specific to iOS devices with notches or status bar areas.
Screenshots