How to disable accessibility for a view including all it's subviews?

11,125

Solution 1

self.accessibilityElementsHidden = YES;

This makes all subviews hidden from accessibility.

Solution 2

I would try setting the accessibilityElementsHidden property of the main view to YES. If that does not what you want, I would try overriding the UIAccessibilityContainer methods on the main view to return 0 children.

Solution 3

Just set the accessibilityElementsHidden property.

Share:
11,125

Related videos on Youtube

openfrog
Author by

openfrog

Thanks a lot to Pascal MARTIN, Gumbo and Quassnoi for their great help. Also many thanks to everyone else answering my questions.

Updated on June 20, 2022

Comments

  • openfrog
    openfrog almost 2 years

    When I set isAccessibilityElement = NO on a view that contains subviews with isAccessibilityElement = YES, VoiceOver still detects them.

    I need to switch off accessibility for an entire view hierarchy that must be handled differently by VoiceOver. How can I achieve this without having to loop through every single item in the object graph and mess with it's setting?

Related