Compose 中的無障礙功能
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
在應用程式中加入無障礙功能,將畫面上顯示的內容轉換成特定需求使用者所需的適當格式。瞭解如何透過少量的工作,提高應用程式的觸及範圍和多功能性。
重點
- 請加入視覺元素的說明,讓無障礙服務知道該做什麼。請使用本地化的字串資源來說明內容,讓使用者能以自己的語言聽到說明。
- 在父項容器中新增語意修飾符,改善無障礙服務的選取行為。
- 如要將自訂動作新增至清單項目,請根據目前狀態定義動作名稱、新增語意修飾符並設定
customActions
屬性,然後清除任何其他語意。
包含此指南的集合
本指南是精選的快速指南系列之一,涵蓋更廣泛的 Android 開發目標:
顯示文字
文字是任何 UI 的核心部分。瞭解在應用程式中呈現文字的不同方式,以提供優質的使用者體驗。
顯示圖片
瞭解如何運用明亮吸睛的視覺元素,為 Android 應用程式打造美觀的視覺效果。
Compose 基礎
本系列影片將介紹各種 Compose API,快速向您展示可用的 API 和使用方式。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-02-06 (世界標準時間)。
[[["容易理解","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-02-06 (世界標準時間)。"],[],[],null,["# Accessibility in Compose\n\n\u003cbr /\u003e\n\nAdd accessibility features to your app, transforming what's shown on screen to a\nmore fitting format for users with specific needs. See how to increase your\napp's reach and versatility with a small amount of work. \n\nKey points\n----------\n\n- Include descriptions of the visual elements so the accessibility services know what to do. Use a localized string resource for content descriptions so users can hear them in their own language.\n- Add a semantics modifier to the parent container to improve the selection behavior of the accessibility service.\n- To add a custom action to a list item: define the name of the action based on the current status, add a semantics modifier and set the [`customActions`](/reference/kotlin/androidx/compose/ui/semantics/package-summary#(androidx.compose.ui.semantics.SemanticsPropertyReceiver).customActions()) property, and clear any additional semantics.\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### Display text\n\nText is a central piece of any UI. Find out different ways you can present text in your app to provide a delightful user experience. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-text) \n\n### Display images\n\nDiscover techniques for using bright, engaging visuals to give your Android app a beautiful look and feel. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-images) \n\n### Compose basics\n\nThis series of videos introduces various Compose APIs, quickly showing you what's available and how to use them. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/compose-basics) \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)"]]