Maui Safe Area
.NET (Microsoft)OfficialPublished by .NET (Microsoft)
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides comprehensive instructions on using the .NET 10+ SafeAreaEdges API. It covers how to manage system bar insets, notch avoidance, and keyboard interaction across Android, iOS, and Mac Catalyst. It includes migration paths from legacy iOS-specific properties and best practices for integrating safe areas into XAML layouts and Blazor Hybrid applications.
What it does
- Explains the SafeAreaEdges property and SafeAreaRegions enum for per-edge control.
- Provides patterns for edge-to-edge immersive layouts and keyboard-aware UI.
- Details migration steps from legacy iOS-only APIs like UseSafeArea.
- Offers guidance on coordinating safe areas in Blazor Hybrid apps using CSS.
- Outlines platform-specific behaviors for Android, iOS, and Mac Catalyst.
- Provides a decision framework for choosing the correct safe area configuration.
When to use it
- When upgrading MAUI projects to .NET 10 and needing to handle system bar overlaps.
- When building immersive, edge-to-edge UI designs like photo viewers or video players.
- When implementing keyboard avoidance for chat or form-heavy interfaces.
- When migrating legacy iOS-specific safe area code to the new cross-platform API.
- When coordinating CSS safe-area-inset variables in Blazor Hybrid applications.
Advantages
- Unified cross-platform API for Android, iOS, and Mac Catalyst.
- Granular, per-edge control over safe area insets.
- Improved support for modern device features like notches and Dynamic Island.
- Clear migration path from legacy platform-specific properties.
Usage examples
- “How do I make my page edge-to-edge in .NET 10?”
- Set SafeAreaEdges="None" on both the ContentPage and the root layout container to ensure content extends behind system bars.
- “How can I make my chat input move with the keyboard?”
- Apply SafeAreaEdges="Container, Container, Container, SoftInput" to the grid containing your input field to ensure it respects system bars while reacting to the soft keyboard.
- “My Android app content is behind the status bar after upgrading to .NET 10.”
- This is expected as the default changed to None. Add SafeAreaEdges="Container" to your ContentPage to restore the previous behavior.
- “How do I handle safe areas in Blazor Hybrid?”
- Set the page to edge-to-edge with SafeAreaEdges="None" and use CSS env(safe-area-inset-*) variables in your stylesheet to handle padding.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/dotnet/maui-safe-area/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip maui-safe-area.zip -d .agents/skills
Documentation by .NET (Microsoft)
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.ResizeBlazor Hybrid apps that need CSS
env(safe-area-inset-*)coordinationMixed 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 APIsTarget platforms: Android, iOS, Mac Catalyst (Windows does not have system bar insets)
UI approach: XAML/C#, Blazor Hybrid, or MauiReactor
SafeAreaRegions Enum
[Flags]
public enum SafeAreaRegions
{
None = 0, // Edge-to-edge — no safe area padding
SoftInput = 1 << 0, // Pad to avoid the on-screen keyboard
Container = 1 << 1, // Stay inside status bar, notch, home indicator
Default = -1, // Use the platform default for the control type
All = 1 << 15 // Respect all safe area insets (most restrictive)
}SoftInput and Container are combinable flags:
SafeAreaRegions.Container | SafeAreaRegions.SoftInput = respect system bars and keyboard.
SafeAreaEdges Struct
public readonly struct SafeAreaEdges
{
public SafeAreaRegions Left { get; }
public SafeAreaRegions Top { get; }
public SafeAreaRegions Right { get; }
public SafeAreaRegions Bottom { get; }
// Uniform — same value for all four edges
public SafeAreaEdges(SafeAreaRegions uniformValue)
// Horizontal / Vertical
public SafeAreaEdges(SafeAreaRegions horizontal, SafeAreaRegions vertical)
// Per-edge
public SafeAreaEdges(SafeAreaRegions left, SafeAreaRegions top,
SafeAreaRegions right, SafeAreaRegions bottom)
}Static presets: SafeAreaEdges.None, SafeAreaEdges.All, SafeAreaEdges.Default.
XAML Type Converter
Follows Thickness-like comma-separated syntax:
<!-- Uniform -->
SafeAreaEdges="Container"
<!-- Horizontal, Vertical -->
SafeAreaEdges="Container, SoftInput"
<!-- Left, Top, Right, Bottom -->
SafeAreaEdges="Container, Container, Container, SoftInput"Control Defaults
| Control | Default | Notes |
|---|---|---|
ContentPage | None | Edge-to-edge. Breaking change from .NET 9 on Android. |
Layout (Grid, StackLayout, etc.) | Container | Respects bars/notch, flows under keyboard |
ScrollView | Default | iOS maps to automatic content insets. Only Container and None take effect. |
ContentView | None | Inherits parent behavior |
Border | None | Inherits parent behavior |
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:
<!-- .NET 10 default — content extends under status bar -->
<ContentPage>
<!-- Restore .NET 9 Android behavior -->
<ContentPage SafeAreaEdges="Container">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:
<ContentPage SafeAreaEdges="None">
<Grid SafeAreaEdges="None">
<Image Source="background.jpg" Aspect="AspectFill" />
<VerticalStackLayout Padding="20" VerticalOptions="End">
<Label Text="Overlay text" TextColor="White" FontSize="24" />
</VerticalStackLayout>
</Grid>
</ContentPage>Forms and critical content
<ContentPage SafeAreaEdges="All">
<VerticalStackLayout Padding="20">
<Label Text="Safe content" FontSize="18" />
<Entry Placeholder="Enter text" />
<Button Text="Submit" />
</VerticalStackLayout>
</ContentPage>Keyboard-aware chat layout
<ContentPage>
<Grid RowDefinitions="*,Auto"
SafeAreaEdges="Container, Container, Container, SoftInput">
<ScrollView Grid.Row="0">
<VerticalStackLayout Padding="20" Spacing="10">
<Label Text="Messages" FontSize="24" />
</VerticalStackLayout>
</ScrollView>
<Border Grid.Row="1" BackgroundColor="LightGray" Padding="20">
<Grid ColumnDefinitions="*,Auto" Spacing="10">
<Entry Placeholder="Type a message..." />
<Button Grid.Column="1" Text="Send" />
</Grid>
</Border>
</Grid>
</ContentPage>Mixed: edge-to-edge header + safe body + keyboard footer
<ContentPage SafeAreaEdges="None">
<Grid RowDefinitions="Auto,*,Auto">
<Grid BackgroundColor="{StaticResource Primary}">
<Label Text="App Header" TextColor="White" Margin="20,40,20,20" />
</Grid>
<ScrollView Grid.Row="1" SafeAreaEdges="Container">
<!-- Use Container, not All — ScrollView only honors Container and None -->
<VerticalStackLayout Padding="20">
<Label Text="Main content" />
</VerticalStackLayout>
</ScrollView>
<Grid Grid.Row="2" SafeAreaEdges="SoftInput"
BackgroundColor="LightGray" Padding="20">
<Entry Placeholder="Type a message..." />
</Grid>
</Grid>
</ContentPage>Programmatic (C#)
var page = new ContentPage
{
SafeAreaEdges = SafeAreaEdges.All
};
var grid = new Grid
{
SafeAreaEdges = new SafeAreaEdges(
left: SafeAreaRegions.Container,
top: SafeAreaRegions.Container,
right: SafeAreaRegions.Container,
bottom: SafeAreaRegions.SoftInput)
};Decision Framework
| Scenario | SafeAreaEdges value |
|---|---|
| Forms, critical inputs | All |
| Photo viewer, video player, game | None (on page and layout) |
| Scrollable content with fixed header/footer | Container |
| Chat/messaging with bottom input bar | Per-edge: Container, Container, Container, SoftInput |
| Blazor Hybrid app | None on page; CSS env() for insets |
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):
<ContentPage SafeAreaEdges="None">
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>Add
viewport-fit=coverinindex.html:
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />Use CSS
env()functions:
body {
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}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
| Legacy (.NET 9 and earlier) | New (.NET 10+) |
|---|---|
ios:Page.UseSafeArea="True" | SafeAreaEdges="Container" |
Layout.IgnoreSafeArea="True" | SafeAreaEdges="None" |
WindowSoftInputModeAdjust.Resize | SafeAreaEdges="All" on ContentPage |
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.
<!-- .NET 9 (legacy, iOS-only) -->
<ContentPage xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="True">
<!-- .NET 10+ (cross-platform) -->
<ContentPage SafeAreaEdges="Container">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 visibleInsets update automatically on rotation and UI visibility changes
ScrollViewwithDefaultmaps toUIScrollViewContentInsetAdjustmentBehavior.Automatic
Transparent navigation bar for content behind the nav bar:
<Shell Shell.BackgroundColor="#80000000" Shell.NavBarHasShadow="False" />Android
Safe area insets cover: system bars (status/navigation) and display cutouts
SoftInputincludes the soft keyboardMAUI uses
WindowInsetsCompatandWindowInsetsAnimationCompatinternallyBehavior 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
Files
- ATTRIBUTION.mdAdded by AutoGineer839 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md12.6 KiB
- references/safe-area-api.md8.4 KiB
SKILL.md
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.ResizeBlazor Hybrid apps that need CSS
env(safe-area-inset-*)coordinationMixed 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 APIsTarget platforms: Android, iOS, Mac Catalyst (Windows does not have system bar insets)
UI approach: XAML/C#, Blazor Hybrid, or MauiReactor
SafeAreaRegions Enum
[Flags]
public enum SafeAreaRegions
{
None = 0, // Edge-to-edge — no safe area padding
SoftInput = 1 << 0, // Pad to avoid the on-screen keyboard
Container = 1 << 1, // Stay inside status bar, notch, home indicator
Default = -1, // Use the platform default for the control type
All = 1 << 15 // Respect all safe area insets (most restrictive)
}SoftInput and Container are combinable flags:
SafeAreaRegions.Container | SafeAreaRegions.SoftInput = respect system bars and keyboard.
SafeAreaEdges Struct
public readonly struct SafeAreaEdges
{
public SafeAreaRegions Left { get; }
public SafeAreaRegions Top { get; }
public SafeAreaRegions Right { get; }
public SafeAreaRegions Bottom { get; }
// Uniform — same value for all four edges
public SafeAreaEdges(SafeAreaRegions uniformValue)
// Horizontal / Vertical
public SafeAreaEdges(SafeAreaRegions horizontal, SafeAreaRegions vertical)
// Per-edge
public SafeAreaEdges(SafeAreaRegions left, SafeAreaRegions top,
SafeAreaRegions right, SafeAreaRegions bottom)
}Static presets: SafeAreaEdges.None, SafeAreaEdges.All, SafeAreaEdges.Default.
XAML Type Converter
Follows Thickness-like comma-separated syntax:
<!-- Uniform -->
SafeAreaEdges="Container"
<!-- Horizontal, Vertical -->
SafeAreaEdges="Container, SoftInput"
<!-- Left, Top, Right, Bottom -->
SafeAreaEdges="Container, Container, Container, SoftInput"Control Defaults
| Control | Default | Notes |
|---|---|---|
ContentPage | None | Edge-to-edge. Breaking change from .NET 9 on Android. |
Layout (Grid, StackLayout, etc.) | Container | Respects bars/notch, flows under keyboard |
ScrollView | Default | iOS maps to automatic content insets. Only Container and None take effect. |
ContentView | None | Inherits parent behavior |
Border | None | Inherits parent behavior |
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:
<!-- .NET 10 default — content extends under status bar -->
<ContentPage>
<!-- Restore .NET 9 Android behavior -->
<ContentPage SafeAreaEdges="Container">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:
<ContentPage SafeAreaEdges="None">
<Grid SafeAreaEdges="None">
<Image Source="background.jpg" Aspect="AspectFill" />
<VerticalStackLayout Padding="20" VerticalOptions="End">
<Label Text="Overlay text" TextColor="White" FontSize="24" />
</VerticalStackLayout>
</Grid>
</ContentPage>Forms and critical content
<ContentPage SafeAreaEdges="All">
<VerticalStackLayout Padding="20">
<Label Text="Safe content" FontSize="18" />
<Entry Placeholder="Enter text" />
<Button Text="Submit" />
</VerticalStackLayout>
</ContentPage>Keyboard-aware chat layout
<ContentPage>
<Grid RowDefinitions="*,Auto"
SafeAreaEdges="Container, Container, Container, SoftInput">
<ScrollView Grid.Row="0">
<VerticalStackLayout Padding="20" Spacing="10">
<Label Text="Messages" FontSize="24" />
</VerticalStackLayout>
</ScrollView>
<Border Grid.Row="1" BackgroundColor="LightGray" Padding="20">
<Grid ColumnDefinitions="*,Auto" Spacing="10">
<Entry Placeholder="Type a message..." />
<Button Grid.Column="1" Text="Send" />
</Grid>
</Border>
</Grid>
</ContentPage>Mixed: edge-to-edge header + safe body + keyboard footer
<ContentPage SafeAreaEdges="None">
<Grid RowDefinitions="Auto,*,Auto">
<Grid BackgroundColor="{StaticResource Primary}">
<Label Text="App Header" TextColor="White" Margin="20,40,20,20" />
</Grid>
<ScrollView Grid.Row="1" SafeAreaEdges="Container">
<!-- Use Container, not All — ScrollView only honors Container and None -->
<VerticalStackLayout Padding="20">
<Label Text="Main content" />
</VerticalStackLayout>
</ScrollView>
<Grid Grid.Row="2" SafeAreaEdges="SoftInput"
BackgroundColor="LightGray" Padding="20">
<Entry Placeholder="Type a message..." />
</Grid>
</Grid>
</ContentPage>Programmatic (C#)
var page = new ContentPage
{
SafeAreaEdges = SafeAreaEdges.All
};
var grid = new Grid
{
SafeAreaEdges = new SafeAreaEdges(
left: SafeAreaRegions.Container,
top: SafeAreaRegions.Container,
right: SafeAreaRegions.Container,
bottom: SafeAreaRegions.SoftInput)
};Decision Framework
| Scenario | SafeAreaEdges value |
|---|---|
| Forms, critical inputs | All |
| Photo viewer, video player, game | None (on page and layout) |
| Scrollable content with fixed header/footer | Container |
| Chat/messaging with bottom input bar | Per-edge: Container, Container, Container, SoftInput |
| Blazor Hybrid app | None on page; CSS env() for insets |
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):
<ContentPage SafeAreaEdges="None">
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Routes}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>Add
viewport-fit=coverinindex.html:
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />Use CSS
env()functions:
body {
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}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
| Legacy (.NET 9 and earlier) | New (.NET 10+) |
|---|---|
ios:Page.UseSafeArea="True" | SafeAreaEdges="Container" |
Layout.IgnoreSafeArea="True" | SafeAreaEdges="None" |
WindowSoftInputModeAdjust.Resize | SafeAreaEdges="All" on ContentPage |
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.
<!-- .NET 9 (legacy, iOS-only) -->
<ContentPage xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="True">
<!-- .NET 10+ (cross-platform) -->
<ContentPage SafeAreaEdges="Container">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 visibleInsets update automatically on rotation and UI visibility changes
ScrollViewwithDefaultmaps toUIScrollViewContentInsetAdjustmentBehavior.Automatic
Transparent navigation bar for content behind the nav bar:
<Shell Shell.BackgroundColor="#80000000" Shell.NavBarHasShadow="False" />Android
Safe area insets cover: system bars (status/navigation) and display cutouts
SoftInputincludes the soft keyboardMAUI uses
WindowInsetsCompatandWindowInsetsAnimationCompatinternallyBehavior 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
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- .NET (Microsoft)
- Publisher
- .NET (Microsoft) (Official)
- Source
- dotnet/skills · plugins/dotnet-maui/skills/maui-safe-area · commit 96c3d68
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by .NET (Microsoft) or .NET (Microsoft).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download maui-safe-area.zip