Wear OS 上的无障碍功能
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建 Wear OS 应用时,首先就应遵循 Android 应用的无障碍功能指南中所述的无障碍功能原则和指南。然后,还要确保您的应用可在 Wear OS 上无障碍使用。
由于以下因素,在无障碍设计方面,Wear OS 应用有一些额外的注意事项:
- Wear OS 上的输入类型不同,例如旋转输入。
- 提供额外的界面 surface,例如图块和复杂功能。
- 屏幕尺寸小,需要不同的 TalkBack 实现。
与无障碍功能方面的其他工作一样,请务必使用屏幕阅读器等辅助技术全面测试每种体验。这样您就可以从用户的角度体验应用,并发现原本可能会忽略的易用性问题。如需了解详情,请参阅测试应用的无障碍功能。
支持用户的首选字体大小
在系统设置中,用户可以调整 Wear OS 应用中显示的文本元素的字体大小。例如,在 Google Pixel Watch 设备上,这些设置位于设置 > 无障碍菜单中。
测试应用时,请将字体大小设置为不同的值,并确保应用的文本内容的行为符合预期。您可以使用如下技巧使应用的文本更易于访问:
启用旋转输入
大多数 Wear OS 设备都包含实体侧面旋钮 (RSB)、旋转边框和触摸边框。这称为旋转输入。您可以使用旋转输入来调整媒体应用的音量、向上或向下滚动内容等。
Wear OS 设备比移动设备小,这造成了额外的挑战。如果用户在操作灵巧度方面有困难,那么在小屏幕上操作时可能很难达到精准。使用屏幕阅读器的用户也可能很难通过双指互动进行滚动。与使用双指互动相比,使用旋转输入功能可实现更方便的滚动方式,从而帮助用户克服上述困难。
如需了解详情,请参阅旋转输入。
针对 TalkBack 优化应用
TalkBack 是 Android 的内置屏幕阅读器。开启 TalkBack 后,用户无需查看屏幕即可与 Android 设备互动。您应测试应用,确保其所有用户体验历程都可以使用屏幕阅读器(例如 TalkBack)完成。如需了解详情,请参阅 TalkBack。
Wear OS 上的 TalkBack 与移动设备上的 TalkBack 大同小异,但有一些额外的注意事项,详见以下各部分的说明。
使用内置组件
Wear OS 提供许多遵循无障碍功能最佳实践设计的内置界面组件。例如,PickerGroup
元素使用焦点协调器对象,将焦点分配给正确的 Picker
元素。
在您的应用中使用这些内置组件可提高应用的易用性,让所有人受益。
为功能块和复杂功能使用内容说明
Wear OS 提供不同的界面 surface,例如图块和复杂功能。
表盘复杂功能可在表盘上直接显示来自各种应用的信息(例如日期或天气预报),所示信息一目了然。图块可让您快速查看所需信息,快速执行处理事项所需的操作。用户只需在表盘上轻轻滑动一下,即可查看天气、设置计时器,以及使用其他功能。
类似于 Compose 视觉元素,您可以为图块和复杂功能设置 contentDescription
。contentDescriptions
定义 Talkback 用来描述任何无文本说明的内容的文本。针对图块和复杂功能使用内容说明时,请注意以下事项:
- 避免在说明中添加对用户来说没有价值的多余文字,例如复杂功能和图块。
- 避免在显示的信息之外再添加文字。例如,复杂功能的说明显示日期 12 月 13 日,则就应为 12 月 13 日,不要添加日和日期。
设置图块的内容说明
使用 setContentDescription
方法,为 TalkBack 读出的图块设置当前的内容说明。
此外,请确保为图块中的所有元素(例如按钮)设置内容说明。
为复杂功能设置内容说明
复杂功能有多种不同的类型,例如在 Builder 上设置了 SmallImageComplication
和 ShortTextComplication. contentDescription
,示例参见 SmallImageComplicationData.Builder
。
了解列表行为
由于穿戴式设备的屏幕尺寸较小,因此 TalkBack 对 Wear OS 上的列表行为做出几点假设。
列表通知
在其他外形规格的设备中,当用户聚焦于列表时,Talkback 会将 in list 添加到其通知中,以便用户了解所处的位置。如果用户离开列表,Talkback 会将 out of list 添加到其通知中。然而在 Wear OS 设备上,由于屏幕较小,TalkBack 会假设每个界面上只能有一个列表。因此,TalkBack 移除了对 in-list 和 out-of-list 通知的支持,以避免出现多余的文字。请不要预期 TalkBack 在 Wear OS 设备上会读出 in-list 和 out-of-list 通知
垂直列表通知
从垂直列表中读取列表项时,Talkback 会避免读出太小或几乎超出屏幕范围的项。具体来说,TalkBack 使用以下两个条件:
- 靠近屏幕顶部或底部的元素。
- 元素高度小于 32dp。
通过确保项的高度至少为 32dp,列表中第一项在顶部有内边距,最后一项在底部有内边距,可使其有效地与 Talkback 协同工作。
这些准则不适用于水平列表。
设置最小触摸目标
触摸目标是屏幕上响应用户输入的部分。它们可能会超出元素的可视边界。例如,某个元素(如图标)的显示大小可能为 24dp x 24dp,但其周围的内边距可以构成完整的 48 x 48 dp 触摸目标。
根据 Android Material 指南,建议的触摸目标大小为 48dp x 48dp。由于 Wear OS 的屏幕尺寸较小,在某些情况下,允许使用 40dp x 40dp 的触摸目标。
如需详细了解如何实现触摸目标,请参阅 Compose 中的无障碍服务。
为您推荐
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Accessibility on Wear OS\n\nAs you create an app on Wear OS, start by following accessibility principles and\nguidance from our [Accessibility guide for Android apps](/guide/topics/ui/accessibility). Then ensure you app\nis accessible on Wear OS as well.\n\nWear OS apps have some additional considerations when it comes to accessibility\ndue to the following factors:\n\n- Different input types on Wear OS, such as rotary input.\n- Additional UI surfaces such as tiles and complications.\n- Small screen sizes, which require different [TalkBack](https://support.google.com/accessibility/android/answer/6283677) implementations.\n\nAs with other accessibility work, make sure to thoroughly test each experience\nwith assistive technologies such as a screen reader. This lets you experience\nyour app from the perspective of your users and discover usability issues that\nyou otherwise might miss. For more information, see [Test your app's\naccessibility](/guide/topics/ui/accessibility/testing).\n\nSupport the user's preferred font size\n--------------------------------------\n\nIn system settings, users can adjust the font size for text elements that appear\nin Wear OS apps. For example, on Google Pixel Watch devices, these settings are\n[located in the **Settings \\\u003e Accessibility** menu](https://support.google.com/googlepixelwatch/answer/12658379).\n\nWhen testing your app, set the font size to different values, and make sure that\nyour app's text content behaves as you expect. You can use techniques such as\nthe following to make your app's text more accessible:\n\n- If you use [autosizing text](/develop/ui/views/text-and-emoji/autosizing-textview), set explicit values for [`autoSizeMinTextSize`](/reference/android/widget/TextView#attr_android:autoSizeMinTextSize) and [`autoSizeMaxTextSize`](/reference/android/widget/TextView#attr_android:autoSizeMaxTextSize).\n- Use an ellipsis to show that text overflows its container. The Material text element [uses an overflow ellipsis by default](/reference/androidx/wear/protolayout/material/Text.Builder#setOverflow(int)).\n\nEnable rotary input\n-------------------\n\nMost Wear OS devices contain a physical rotating side button (RSB), rotating\nbezel or touch bezel. This is called a rotary input. You can use the rotary\ninput to adjust the volume of media apps, scroll content up or down, and more.\n\nWear OS devices are smaller than mobile devices, which presents additional\nchallenges. Users with dexterity challenges may find accuracy on a small screen\ndifficult. Screen reader users may also find it difficult to use two-finger\ninteractions for scrolling. Using rotary input assists users with these\nchallenges by providing a more convenient way to scroll rather than using the\ntwo-finger interaction.\n\nFor more information, see [Rotary input](/training/wearables/user-input/rotary-input).\n\nOptimize your app for Talkback\n------------------------------\n\nTalkBack is Android's built-in screen reader. When TalkBack is on, users can\ninteract with their Android-powered device without seeing the screen. Test your\napp to ensure that all user journeys can be navigated using screen readers such\nas TalkBack. For more information, see [TalkBack](/guide/topics/ui/accessibility/testing#talkback).\n\nTalkBack on Wear OS is similar to TalkBack on mobile with a few additional\nconsiderations, detailed in the following sections.\n\n### Use built-in components\n\nWear OS provides many built-in UI components that already follow accessibility\nbest practices. For example, the [`PickerGroup`](/reference/kotlin/androidx/wear/compose/material/package-summary#PickerGroup(kotlin.Array,androidx.compose.ui.Modifier,androidx.wear.compose.material.PickerGroupState,kotlin.Function1,kotlin.Boolean,kotlin.Boolean,androidx.wear.compose.material.TouchExplorationStateProvider,kotlin.Function1)) element uses a focus\ncoordinator object to assign focus to the correct `Picker` element.\n\nUse these built-in components in your app to improve its\nusability for everyone.\n\n### Use content descriptions for tiles and complications\n\nWear OS provides different UI surfaces, such as tiles and complications.\n\n[Watch face complications](/training/wearables/watch-faces/complications) display highly glanceable information from apps\ndirectly on the watch face, such as the date or weather forecasts. [Tiles](/training/articles/wear-tiles)\nprovide quick access to the information and actions needed to get things done.\nWith a simple swipe from the watch face, a user can check the weather, set a\ntimer, and more.\n\nSimilarly to [Compose](/jetpack/compose/accessibility#describe-visual) visual elements, you can set a `contentDescription`\nfor tiles and complications. `contentDescriptions` define the text that Talkback\nuses to describe any content that does not have a textual representation.\nWhen using content descriptions for tiles and complications, keep in mind the\nfollowing:\n\n- Avoid adding extra words to the description that don't provide user value, such as complication and tile.\n- Avoid adding words beyond the information that is displayed. For example the description of a complication is displaying the date **December 13th** should be **December 13th** without words like **Day** and **Date**.\n\n#### Set the content descriptions for Tiles\n\nUse the method [`setContentDescription`](/reference/android/service/quicksettings/Tile#setContentDescription%28java.lang.CharSequence%29) to set the current content\ndescription for the Tile that Talkback verbalizes.\n\nAlso make sure to set the content description for any elements within the tiles,\nlike [Buttons](/reference/androidx/wear/tiles/material/Button.Builder#setContentDescription(java.lang.CharSequence)).\n\n#### Set the content descriptions for complications\n\nThere are different [types](/training/wearables/watch-faces/adding-complications#types-fields) of complications such as\n`SmallImageComplication` and `ShortTextComplication. contentDescription` is set\non the Builder, for example see the [`SmallImageComplicationData.Builder`](/reference/androidx/wear/watchface/complications/data/SmallImageComplicationData.Builder#Builder(androidx.wear.watchface.complications.data.SmallImage,androidx.wear.watchface.complications.data.ComplicationText)).\n\n### Understand list behaviors\n\nDue to the small screen size on wearable devices, TalkBack makes several\nassumptions about list behavior on Wear OS.\n\n#### List Announcements\n\nIn other form factors, when a user is focused on a list, Talkback adds **in\nlist** to its announcements so that a user understands where they are. If they\nnavigate out of the list, Talkback adds **out of list** to its\nannouncements. But on Wear OS, TalkBack assumes that there is only one list\npossible per UI due to the small screen size. So, it has removed support for\nin-list and out-of-list announcements to avoid redundant wording. Don't expect\nin-list and out-of-list announcements to be read out on Wear OS.\n\n#### Vertical list announcing\n\nWhen reading items from a vertical list, Talkback avoids reading out items that\nare too small or are almost off of the screen. Specifically, talkback uses the\nfollowing two conditions:\n\n1. Elements near the top or the bottom of the screen.\n2. Elements less than 32dp in height.\n\nWork effectively with Talkback by ensuring that items are at least 32dp in\nheight, the first item in the list has padding from the top, and the last item\nhas padding from the bottom.\n\nThese guidelines don't apply to horizontal lists.\n\nSet minimum touch targets\n-------------------------\n\nTouch targets are the parts of the screen that respond to user input. They can\nextend beyond the visual bounds of an element. For example, an element such as\nan icon may appear to be 24dp x 24dp, but the padding surrounding it can\nmake up the full 48 x 48 dp touch target.\n\nBased on [Android Material guidance](https://m3.material.io/foundations/accessible-design/accessibility-basics#28032e45-c598-450c-b355-f9fe737b1cd8), 48dp x 48dp is the\nrecommended touch target size. Due to the small screen size on Wear OS, there\nare some situations where 40dp x 40dp is allowed.\n\nFor more information about how to implement touch targets, see [Accessibility in\nCompose](/jetpack/compose/accessibility#minimum-target-sizes).\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Picker](/design/ui/wear/guides/components/pickers)\n- [Loading images {:#loading-images}](/develop/ui/compose/graphics/images/loading)\n- [Key steps to improve Compose accessibility](/develop/ui/compose/accessibility/key-steps)"]]