Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

praveenkumarkarunanithi
Copy link
Contributor

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. If ios: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 the UseSafeArea property defaults to false for FlyoutPage.

Issues Fixed

Fixes #29170

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Note

This issue is specific to iOS devices with notches or status bar areas.

Screenshots

Before Issue Fix After Issue Fix
withoutfix withfix

Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Apr 30, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).


[Test]
[Category(UITestCategories.FlyoutPage)]
public void CollectionViewFirstItemShouldNotOverlapWithSafeAreaInFlyoutMenu()
Copy link
Contributor

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

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-flyoutpage FlyoutPage community ✨ Community Contribution 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 not rendering first item correctly in FlyoutPage.Flyout
2 participants