Safe Area & Edge-to-Edge Layout (.NET 10+)
.NET 10 introduces a brand-new, cross-platform safe area API that replaces the legacy iOS-only UseSafeArea and the layout-level IgnoreSafeArea properties. The new SafeAreaEdges property and SafeAreaRegions flags enum give you per-edge, per-control safe area management on Android, iOS, and Mac Catalyst from a single API surface.
This is new API surface in .NET 10. If the project targets .NET 9 or earlier, these APIs do not exist. Guide the developer to the legacy
ios:Page.UseSafeAreaandLayout.IgnoreSafeAreaproperties instead.
When to Use
- Content overlaps status bar, notch, Dynamic Island, or home indicator after upgrading to .NET 10
- Implementing edge-to-edge / immersive layouts (photo viewers, video players, maps)
- Keyboard avoidance for chat or form UIs
- Migrating from
ios:Page.UseSafeArea,Layout.IgnoreSafeArea, orWindowSoftInputModeAdjust.Resize - Blazor Hybrid apps that need CSS
env(safe-area-inset-*)coordination - Mixed layouts with an edge-to-edge header but a safe-area-respecting body
When Not to Use
- Projects targeting .NET 9 or earlier — use the legacy iOS-specific APIs
- General page layout questions unrelated to system bars or keyboard — use standard layout guidance
- App lifecycle or navigation structure — use maui-app-lifecycle or Shell guidance
- Theming or visual styling — use the maui-theming skill
Inputs
- Target framework: must be
net10.0-*or later for the new APIs - Target platforms: Android, iOS, Mac Catalyst (Windows does not have system bar insets)
- UI approach: XAML/C#, Blazor Hybrid, or MauiReactor
SafeAreaRegions Enum
SoftInput and Container are combinable flags:
SafeAreaRegions.Container | SafeAreaRegions.SoftInput = respect system bars and keyboard.
SafeAreaEdges Struct
Static presets: SafeAreaEdges.None, SafeAreaEdges.All, SafeAreaEdges.Default.
XAML Type Converter
Follows Thickness-like comma-separated syntax:
Control Defaults
Breaking Changes from .NET 9
ContentPage default changed to None
In .NET 9, Android ContentPage behaved like Container. In .NET 10, the default is None on all platforms. If your Android content goes behind the status bar after upgrading:
WindowSoftInputModeAdjust.Resize superseded
WindowSoftInputModeAdjust.Resize still exists and still compiles (it is not removed and not obsolete), but it is Android-only. For cross-platform keyboard avoidance prefer SafeAreaEdges="All" (or the SoftInput region) on the ContentPage.
Usage Patterns
Edge-to-edge immersive content
Set None on both page and layout — layouts default to Container:
Forms and critical content
Keyboard-aware chat layout
Mixed: edge-to-edge header + safe body + keyboard footer
Programmatic (C#)
Decision Framework
Blazor Hybrid Integration
For Blazor Hybrid apps, let CSS handle safe areas to avoid double-padding.
- Page stays edge-to-edge (default in .NET 10):
- Add
viewport-fit=coverinindex.html:
- Use CSS
env()functions:
Available CSS environment variables: env(safe-area-inset-top), env(safe-area-inset-bottom), env(safe-area-inset-left), env(safe-area-inset-right).
Migration from Legacy APIs
The legacy ios:Page.UseSafeArea and Layout.IgnoreSafeArea properties still compile but are marked obsolete. IgnoreSafeArea="True" maps internally to SafeAreaRegions.None. WindowSoftInputModeAdjust.Resize is not obsolete — it remains supported, but is Android-only.
Platform-Specific Behavior
iOS & Mac Catalyst
- Safe area insets cover: status bar, navigation bar, tab bar, notch/Dynamic Island, home indicator
SoftInputincludes the keyboard when visible- Insets update automatically on rotation and UI visibility changes
ScrollViewwithDefaultmaps toUIScrollViewContentInsetAdjustmentBehavior.Automatic
Transparent navigation bar for content behind the nav bar:
Android
- Safe area insets cover: system bars (status/navigation) and display cutouts
SoftInputincludes the soft keyboard- MAUI uses
WindowInsetsCompatandWindowInsetsAnimationCompatinternally - Behavior varies by Android version and OEM edge-to-edge settings
Common Pitfalls
-
Forgetting to set
Noneon the layout too.ContentPage SafeAreaEdges="None"makes the page edge-to-edge, but child layouts default toContainerand still pad inward. SetNoneon both page and layout for truly immersive content. -
Using
SoftInputdirectly on ScrollView. ScrollView manages its own content insets and ignoresSoftInput. Wrap the ScrollView in a Grid or StackLayout and applySoftInputthere. -
Confusing
DefaultwithNone.Defaultmeans "platform default for this control type" — on ScrollView (iOS) this enables automatic content insets.Nonemeans "no safe area padding at all." -
Double-padding in Blazor Hybrid. Setting
SafeAreaEdges="Container"on the page and using CSSenv(safe-area-inset-*)results in doubled insets. Pick one approach — CSS is recommended for Blazor. -
Missing
viewport-fit=coverin Blazor. Without this meta tag, CSSenv(safe-area-inset-*)values are always zero on iOS. -
Assuming .NET 9 behavior on Android. After upgrading to .NET 10, Android
ContentPagedefaults toNone(was effectivelyContainer). AddSafeAreaEdges="Container"to restore the previous behavior. -
Using legacy
ios:Page.UseSafeAreain new code. The old API is iOS-only and obsolete. Always useSafeAreaEdgesfor cross-platform safe area management.
Checklist
- Android upgrade:
SafeAreaEdges="Container"added if content goes under status bar - Edge-to-edge:
Noneset on both page and layout - ScrollView keyboard avoidance uses wrapper Grid, not ScrollView's own
SafeAreaEdges - Blazor Hybrid: using either XAML or CSS safe areas, not both
-
viewport-fit=coverin Blazor'sindex.html<meta viewport>tag - Legacy
UseSafeArea/IgnoreSafeAreamigrated toSafeAreaEdges


