简体   繁体   English

Android辅助功能:切换访问视图元素的扫描顺序

[英]Android Accessibility: Switch access view elements scan order

I am designing an accessibility application in android which will be accessed using a bluetooth switch. 我正在用android设计一个可访问性应用程序,该应用程序将使用蓝牙开关进行访问。 The bluetooth switch will have two buttons: 蓝牙开关将具有两个按钮:

"Next" to navigate through the view elements & "Enter" to click the view elements. 单击“下一步”以浏览视图元素,并单击“输入”以单击视图元素。

The problem that I am facing now is, I would like the focusing to the view elements to start from a certain view and then specify the focus ordering to other view elements and other elements like Keyboard rows etc I know that in layout xml, we can specify the next Focus with "nextFocusForward" but that is not helping my case. 我现在面临的问题是,我希望聚焦于视图元素从某个视图开始,然后指定聚焦于其他视图元素和其他元素(例如键盘行)的顺序,我知道在布局xml中,我们可以用“ nextFocusForward”指定下一个焦点,但这对我的情况没有帮助。

What I want is to specify which of my view elements gets the scan focus first, and then next and so on. 我想要的是指定我的哪些视图元素首先获得扫描焦点,然后再获得扫描焦点,依此类推。 I may be able to set the next focus, but how do I set the very first focus? 我也许可以设置下一个焦点,但是如何设置第一个焦点? Also, how do I set the focus ordering in the ActionBar. 另外,如何在ActionBar中设置焦点顺序。

My ideal ordering will be(on the following example screen): EditText -> keyboard / keyboard rows / The button row(and the buttons)/ The actionable elements.) 我的理想排序是(在以下示例屏幕上):EditText->键盘/键盘行/按钮行(和按钮)/可操作的元素。)

在此处输入图片说明

Can you please help me with this? 你能帮我吗? Thanks in advance! 提前致谢!

Try using android:accessibilityTraversalBefore="@+id/viewId" 尝试使用android:accessibilityTraversalBefore="@+id/viewId"

This will set the id of a view before which this one is visited in accessibility traversal. 这将设置视图的ID,在此视图之前将在可访问性遍历中访问该视图。 A screen-reader must visit the content of this view before the content of the one it precedes. 屏幕阅读器必须先访问此视图的内容,然后再访问该视图的内容。

More documentation : https://developer.android.com/reference/android/view/View.html#attr_android:accessibilityTraversalBefore 更多文档: https : //developer.android.com/reference/android/view/View.html#attr_android : accessibilityTraversalBefore

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM