我有四个TextViews,我试图控制当用户使用TalkBack和触摸手势导航时获得焦点的顺序.
TextView android:text="foo" android:clickable="false" android:focusable="true" android:focusableInTouchMode="true" android:id="@+id/id_foo" android:nextFocusDown="@+id/id_baz"/>
TextView android:text="bar" android:clickable="false" android:focusable="true" android:focusableInTouchMode="true" android:id="@+id/id_bar" android:nextFocusDown="@+id/id_qux"/>
TextView android:text="baz" android:clickable="false" android:focusable="true" android:focusableInTouchMode="true" android:id="@id/id_baz" android:nextFocusDown="@id/id_bar"/>
TextView android:text="qux" android:clickable="false" android:focusable="true" android:focusableInTouchMode="true" android:id="@id/id_qux" android:nextFocusDown="@id/id_foo"/>
Run Code Online (Sandbox Code Playgroud)
当用户打开TalkBack时,触摸"foo",然后向下滑动以在TextView之间导航,我希望订单转到foo-> baz-> bar-> qux.但是,我尝试使用nextFocusDown设置的顺序似乎没有效果,而焦点顺序总是只跟随屏幕上TextView的位置.我已经尝试了clickable,focusable和focusableInTouchMode的所有可能组合.我试过在代码中的视图上调用setNextFocusDownId.我试过在TextViews上设置android:imeOptions ="actionNext".似乎没什么用.我错过了什么?