What's the preferred way to handle long numbers, like a bank account number, that should be read one character at a time? I know users can get TalkBack to read out a number this way, but it would be nice if we could hint that it should do this from the start.

Is it a good idea to set a content description with spaces between the numbers, or will users find this annoying?

Thanks!

有帮助吗?

解决方案

I have talked to several screen-reader users and they have all confirmed that we shouldn't go out of our way to do anything out of the ordinary in cases like this. They all say "Don't worry, we can figure it out. You don't need to help us."

If a screen reader user gets to an area that they need more clarity on they will use their arrow keys to go character by character until they are satisfied and continue on letting the screen-reader continue.

其他提示

Use the following delegate for your editText or textView

@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {

        switch (host.getId()) {
            case R.id.tv_bookingID:
                if (((TextView) host).getText().length() > 1) {
                    sb.delete(0, sb.length());
                    for (char c : ((TextView) host).getText().toString().toCharArray()) {
                        sb.append(c).append(" ");
                    }
                    //change text for talkback
                    info.setText(null);
                    info.setContentDescription(sb.toString().trim());

                }
                break;
        }
    }//if
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top