UITableViewCellAccessoryDisclosureIndicator is not accessible

480 Views Asked by At

I have a table view that its cell's accessory type has been set to UITableViewCellAccessoryDisclosureIndicator. But only the text is accessible when voice over is on and not the DisclosureIndicator. In the Settings app, cells are read like "General Button". I basically want to have this behaviour in my app too.

Any help would be appreciated.

2

There are 2 best solutions below

1
David Rönnqvist On BEST ANSWER

If you want to inform the user that an element behaves like a button, you can add the "button" trait to it.

yourElement.accessibilityTraits |= UIAccessibilityTraitButton;

Doing this will have the system read a localized version of "Button" after reading the label of that accessibility element.

0
Shiyan Xu On

On a simulator, you can turn on accessibility inspector to inspect your UI element's accessibility information.

Open your simulator's settings -> General -> Accessibility -> Accessibility Inspector

From the inspector, you can see the cell in settings has a "Button" trait set along with the original trait "Static text". So you can set the traits as suggested by David Rönnqvist.