Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable accessibility for custom static UITableViewCell

I have a storyboard containing a UITableViewController with static content. The cells are very simple, containing just a single UILabel. If I now want to disable accessibility on one of the cells, I simply uncheck the mark on the label. This works as expected.

However if I now create an empty subclass of UITableViewCell and use this as the cell class for my static cell, accessibility will be enabled, ignoring all settings.

I tried overriding -isAccessibilityElement to return NO, programmatically setting all child views accessibilityElement property to NO, but it still will be selectable when using VoiceOver. The content won't be read by VoiceOver, only a single " " seems to be there (can be heard when swiping up/down on this element).

What do I need to do to disable accessibility for my custom cell?

like image 472
Alfonso Avatar asked May 23 '14 08:05

Alfonso


1 Answers

Maybe, this way is easier.

cell.textLabel.accessibilityElementsHidden = YES;

Look this post

;)

like image 141
debiasej Avatar answered Sep 17 '22 16:09

debiasej