문제

I am making an app that is accessible to the blind. I am using android's accessibility framework. Currently I am running into an issue with the order items in a listview are being read to the user.

For example, I have a list view where each row has the values "place, name, level, score", in that order.

When navigating with droid's talkback turned on, the elements in each row are read out of order, for example it reads "level, score, place, name".

I have tried to set focus on the first element in the list item using requestFocus(), and also set the focus within the XML, yet nothing seems to work.

Any help is very appreciated. Thanks!

도움이 되었습니까?

해결책

TalkBack reads contained items in screen position order (e.g. left to right, top to bottom for LTR locales like English).

You have two options:

  1. In your XML layout for the row, ensure the top-left coordinates of your value views are in the correct position for how you would like them read aloud.
  2. Specify a content description for the container that explicitly orders the values.

The second option looks like:

row.setContentDescription(place.getText() + " " + name.getText() + ...);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top