Android: How to eliminate spoken text from AccessibilityEvents when extending SeekBar?

后端 未结 2 1446
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 14:33

My Android app contains a custom slider control based on the SeekBar, and I want to attach a custom text phrase to my control to explain its use for Accessibili

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-06 14:41

    You also need to override http://developer.android.com/reference/android/view/View.html#onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo)

    and set the contentDescription there.

    If you want to remove the 0%, I would try to change the class in AccessibilityNodeInfo/AccessibilityEvent: http://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html#setClassName(java.lang.CharSequence)

提交回复
热议问题