Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessibility Label for radio button on action?

In TableViewCell, I have custom imageview which act as a radio button. This imageview has two states

  1. Selected
  2. Not Selected

enter image description here

By default I have given, Accessibility label as "Selected Checkbox" and "checkbox". Now I want to speak voice text as "new item selected" when it selects and "item deselected" when deselected.

Can we give all four different label? How can I get the same.

Updated: I tried using

UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification,@"text")

but it skips the text which need to speak.

like image 232
Sanoj Kashyap Avatar asked Nov 13 '17 09:11

Sanoj Kashyap


1 Answers

I'm not entirely sure what you are attempting to do here but I'll try to provide an alternative way of making this accessible.

Instead of treating each radio button as either selected or deselected would it not be better to treat the entire group of radio buttons as one combined accessibility element.

So if you have radio buttons for [cat, dog, rabbit, guinea pig]. Then your accessibility should read something like...

Animal selection group: none selected

or

Animal selection group: rabbit selected

etc...

Having said all of that... what is this UI you are trying to create?

Radio buttons are fundamentally not a part of iOS. It would be a much better alternative to use UI that users know. And then by doing this you make your accessibility issue a non-issue.

Perhaps a UIPickerView or a UITableView might be better alternatives to radio buttons?

like image 151
Fogmeister Avatar answered Sep 19 '22 03:09

Fogmeister