Android 9 引入了 accessibilityHeading
标签,可由对讲使用以宣布标题。
https://developer.android.com/about/versions/pie/android-9.0#a11y
寻找Heading-based navigation
在我的应用程序中,我的 Activity 中有多个带有一些标题的 TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:accessibilityHeading="true"
android:text="Accessibility Heading 1"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="Message"
android:textColor="#000000" />
但是当我运行该应用程序时,标题仅被视为普通 TextView ,Talkback
没有给予任何特殊处理。 .
我可以向左滑动来浏览所有元素。
可以选择向上滑动以更改对讲公告的模式。例如 Default
, Links
, Controls
, Headings
等
选择时Headings
,我希望对讲仅宣布标题并从一个标题跳到另一个标题,但即使在 Swipe Left
之后它仍保持在同一位置或 Swipe Right
手势。
最佳答案
同时将 accessibilityHeading
和 focusableInTouchMode
设置为 true
。然后,将导航模式设置为 Headers
(您可以通过 up down
手势),滑动 up
或 down
通过 header 导航您。 向右
和向左
滑动仍可让您浏览单个项目。
关于android - 使用对讲时通过滑动在标题之间导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52642769/