Compose 中的邊框
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
邊框會提供系統 UI 的相關資訊,確保應用程式在正確的區域中繪製,且系統 UI 不會遮蓋使用者介面。瞭解邊框如何向應用程式傳達系統裝飾的位置,以及 Compose API 如何協助內容隨著系統列、軟體鍵盤和工作列移動。
重點
- Insets 會說明應用程式內容的填充量,以免與系統 UI 或實體裝置功能的部分重疊。
- 不同類型的內嵌區塊包括狀態列、導覽列、軟體鍵盤等。
- 在應用程式執行期間,邊框可能會因系統設定和視窗環境而變更,例如裝置方向、多視窗模式設定,或使用者可控設定。
- 直接處理內嵌,充分運用螢幕空間,並改善應用程式在各板型規格中的外觀和功能。
包含此指南的集合
本指南是精選的快速指南系列之一,涵蓋更廣泛的 Android 開發目標:
建立主畫面鷹架
瞭解如何使用標準化平台建構複雜的使用者介面。這個結構體會將 UI 的不同部分結合在一起,讓應用程式呈現一致的外觀和風格。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Insets in Compose\n\n\u003cbr /\u003e\n\nInsets provide information about the system UI to ensure that your app draws in\nthe correct area and your UI isn't obscured by the system UI. Learn how insets\ncommunicate to your app where system decorations are placed, and how Compose\nAPIs help your content move with the system bars, software\nkeyboard, and the taskbar. \n\nKey points\n----------\n\n- *Insets* describe how much you need to pad the content of your app to avoid overlapping with parts of the system UI or physical device features.\n- Different types of insets include the status bars, navigation bars, software keyboard, and more.\n- Insets can change while your app is running, depending on the system configuration and windowing environment, such as device orientation, multi-window mode setup, or user controllable settings.\n- Handle insets directly to make full use of the screen space and improve how your app looks and functions across form factors.\n\nCollections that contain this guide\n-----------------------------------\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\n### Create a home screen scaffold\n\nFind out how to use a standardized platform to build complex user interfaces. The scaffold holds together different parts of the UI, giving apps a coherent look and feel. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/create-a-home-screen-scaffold) \n\nHave questions or feedback\n--------------------------\n\nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]