Repository navigation
Description
Summary
In .NET 10 the safe-area model became per-edge and much more expressive (SafeAreaEdges / SafeAreaRegions), but only MAUI's own types can participate in it. A custom view — including one whose platform view is a MauiView — cannot declare its own safe-area strategy beyond the legacy all-or-nothing opt-out.
What is public today, and what is not
| API | Visibility |
|---|---|
SafeAreaRegions (enum), SafeAreaEdges (struct) |
public |
ISafeAreaView (net9 model: bool IgnoreSafeArea) |
public |
ISafeAreaView2 (GetSafeAreaRegionsForEdge(int), HasExplicitSafeAreaEdges) |
internal |
ISafeAreaElement, SafeAreaElement (the SafeAreaEdgesProperty plumbing) |
internal |
SafeAreaEdges property |
declared per type (Layout, Border, ScrollView, ContentPage), not on VisualElement / IView |
MauiView (iOS) resolves the behavior like this:
if (View is ISafeAreaView2 v2) return v2.GetSafeAreaRegionsForEdge(edge); // internal → MAUI types only
if (View is ISafeAreaView v1) return v1.IgnoreSafeArea ? None : Container; // public, but all-or-nothing
return SafeAreaRegions.None;So a third-party control can hold a public SafeAreaEdges value, but nothing in the platform layer will ever honor it.
Consequences
1. Custom views cannot express a real strategy. A control deriving from View (not Layout/Border/ScrollView/ContentPage) can only implement the legacy ISafeAreaView, i.e. "obey everything" or "ignore everything". It cannot say "consume the bottom edge only", or use SoftInput semantics, even though its platform view is a MauiView that already implements all of it internally. Adding its own SafeAreaEdges bindable property does not help: the property plumbing (ISafeAreaElement / SafeAreaElement.SafeAreaEdgesProperty) is internal, and reading the shared property on an object that does not implement the internal interface throws from SafeAreaEdgesDefaultValueCreator.
2. Hosts can no longer read the strategy — a regression from net9. Code that embeds a MAUI view inside a native container (custom navigation/tab chrome mounted in a plain UIView) has to know whether that view folds the system inset into its own measure or deliberately goes edge-to-edge, in order to size the container. In net9 the public ISafeAreaView answered that; in net10+ there is no public equivalent, so the host is left inferring the answer from measurement deltas.
Request
For .NET 11:
- make
ISafeAreaView2public, so custom views can both declare a per-edge strategy and have hosts read it, and - ideally make the
SafeAreaEdgesbindable-property plumbing reusable by third-party controls (publicISafeAreaElement/ a sharedSafeAreaEdgesProperty), so a custom control gets the same XAML surface as the built-in types.
Restoring at least the level of access that net9's public ISafeAreaView provided would already unblock the hosting scenario; making the per-edge API public is what unblocks custom views.
A public accessor has a second benefit: hosts and custom controls can follow whatever semantics MAUI settles on for SafeAreaRegions.Default (see #34872) instead of hard-coding an interpretation of the enum.
Version
Observed on MAUI 10.0.80 (net10.0-ios); request targets net11.
Activity
[net11.0] Expose safe area contract for custom views (#38039)
github-actions commentedon Aug 31, 2026
Closed by #38039 (merged to
net11.0). GitHub only auto-closes for PRs merged to the default branch; this issue was fixed by a PR merged to a non-default branch.