본문으로 건너뛰기
Skillpedia
모바일 앱5.8k · #14587

maui-safe-area

하는 일

이 스킬은 .NET 10 이상을 위한 .NET MAUI 앱의 안전 영역과 가장자리까지 채우는 레이아웃을 안내합니다. 콘텐츠가 시스템 표시줄이나 키보드와 겹치는 휴대폰과 태블릿 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓업데이트 후 콘텐츠가 상태 표시줄, 노치, 홈 표시기와 겹칠 때.
  • ✓사진 뷰어나 지도처럼 가장자리까지 채우는 화면을 원할 때.
  • ✓채팅이나 양식 화면이 키보드를 피해야 할 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-maui/skills/maui-safe-area/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-maui/skills/maui-safe-area/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Android에서 제 MAUI 채팅 화면이 키보드 뒤에 가려집니다. 입력란이 계속 보이도록 레이아웃을 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 프로젝트의 대상 버전을 확인하고, 최신 안전 영역 설정은 각 가장자리에 쓰고, 이전 버전에는 기존 플랫폼별 설정을 씁니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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.UseSafeArea and Layout.IgnoreSafeArea properties 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, or WindowSoftInputModeAdjust.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

[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 o

자주 묻는 질문

.NET 9에서도 되나요?

새 설정은 안 됩니다. .NET 9 이하에서는 기존 플랫폼별 설정을 씁니다.

키보드 회피도 다루나요?

네. 키보드 회피는 다루는 경우 중 하나입니다.

Blazor Hybrid 앱도 다루나요?

네. Blazor Hybrid를 위한 CSS 안전 영역 값을 다룹니다.

상세 정보

작성자의 원본 설명

.NET MAUI safe area and edge-to-edge layout guidance for .NET 10+. Covers the new SafeAreaEdges property, SafeAreaRegions enum, per-edge control, keyboard avoidance, Blazor Hybrid CSS safe areas, migration from legacy iOS-only APIs, and platform-specific behavior for Android, iOS, and Mac Catalyst. USE FOR: "safe area", "edge-to-edge", "SafeAreaEdges", "SafeAreaRegions", "keyboard avoidance", "notch insets", "status bar overlap", "iOS safe area", "Android edge-to-edge", "content behind status bar", "UseSafeArea migration", "soft input keyboard", "IgnoreSafeArea replacement". DO NOT USE FOR: ge

repo: dotnet/skills

인기도

GitHub 스타
5.8k
순위
#14587
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬