简体   繁体   中英

iOS: UIAccessibility (Voice Over) with checkbox is not working properly

I am using voice over on checkbox.

The issue I am facing here is, when user selects the checkbox for the first time it says 'checkbox selected' (which is correct as per accessibilityLabel set) but next time when user tries to de-select it says 'checkbox selected, checkbox de-selected' where it should only say 'checkbox de-selected', vice-a-versa.

So what is happening here is that, the previously set accessibilityLabel is not getting cleared up and when user tries to select or de-select it takes the both previous and currently set label.

Note- using custom checkbox, toggling UIButton with selected/de-selected image.

How to solve this conflict?

If you create your checkbox thanks to a UIButton item, I suggest to :

  • Untick the button UIAccessibilityTraits .
  • Provide a clear hint when the checkbox is first selected : "double tap to change the value" .
  • Update your button accessibility label thanks to IBAction when the box is toggled.

However, it's always better to create a UIAccessibilityElement that contains your check box and a label that describes what it refers to ⟹ when you double tap this accessible wrapper with one finger, the checkbox value toggles and your initial problem disappears.

Following these steps will provide an appropriate user experience with no checkbox VoiceOver conflict that you noticed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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