Implement SafeAreaEdges property for per-edge safe area control#30337
Merged
StephaneDelcroix merged 34 commits intonet10.0from Jul 28, 2025
Merged
Implement SafeAreaEdges property for per-edge safe area control#30337StephaneDelcroix merged 34 commits intonet10.0from
StephaneDelcroix merged 34 commits intonet10.0from
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
SafeArea Feature Specification
Caution as you test this PR
The safe area calculations in some scenarios are off until we can merge this PR #30629. These aren't bugs with this PR they are general bugs we've been trying to fix for sometimes.
Overview
The SafeArea feature provides fine-grained, per-edge safe area control for .NET MAUI applications, enabling developers to selectively control safe area behavior on specific edges while maintaining backward compatibility.
Public APIs
1. SafeAreaRegions Enum
2. SafeAreaEdges Struct
3. SafeAreaEdges Properties
Available on these controls:
Layout.SafeAreaEdgesContentView.SafeAreaEdgesContentPage.SafeAreaEdgesBorder.SafeAreaEdgesScrollView.SafeAreaEdges4. XAML TypeConverter
Supports multiple input formats:
"None"or"All"- applies to all edges"All,None"- horizontal,vertical pattern"All,None,All,None"- Left,Top,Right,Bottom orderUsage Examples
XAML Usage
C# Usage
Behavior Specification
SafeAreaRegions Behaviors
Control-Specific Defaults
Allwhen value isDefaultNonewhen value isDefaultDefaultwhen value isDefault(uses iOS ContentInsetAdjustmentBehavior)Platform Integration
iOS Implementation
.automatic.never.always.neverwith manual ContentInset calculationInterface Integration
IgnoreSafeAreaForEdge(int edge)andSafeAreaInsetssetterBackward Compatibility
Layout.IgnoreSafeAreaproperty continues to work unchangedTesting Coverage