Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VoiceOver controls are selectable when hidden

Tags:

ios

voiceover

I have a UIView which contains some controls (e.g. buttons, labels, etc). I overlay this view onto another view (using addSubview). If the user has VoiceOver on, he can swipe left and right to select the controls. However if I hide the view so the controls are no longer visible, the user is still able to swipe and select them (although they don't actually work). Since this is very confusing to a blind user, I would like to keep this from happening. I have even tried removing the view that contains the controls (using removeFromSuperview) but the user can STILL swipe to select them (although the little boxes which highlights them are no longer in the correct positions). It is like VoiceOver has memorized that those controls were once there and will remember that forever more.

I also found the property 'accessibilityElementsHidden' and I have tried setting that to YES on the view which contains the controls when it is hidden, but that does not seem to work either.

Is this a bug in VoiceOver, or am I missing something? Is there a workaround?

Thanks.

like image 244
John Gaby Avatar asked Jan 13 '12 04:01

John Gaby


People also ask

What is the point of VoiceOver on iPhone?

With VoiceOver—a gesture-based screen reader—you can use iPhone even if you can't see the screen. VoiceOver gives audible descriptions of what's on your screen—from battery level, to who's calling, to which app your finger is on. You can also adjust the speaking rate and pitch to suit your needs.

What does VoiceOver do?

Voice-over is a production technique where an off-camera actor or person records dialogue for use in a film, TV show, documentary, announcement, or commercial during the post-production process. Productions use voice-over narration to provide additional context to the visuals or as a form of guided narration.


2 Answers

The "memorized" part makes me think you aren't doing something like UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil) after removing the subviews.

like image 191
David Dunham Avatar answered Oct 05 '22 17:10

David Dunham


The documentation for "accessibilityElementsHidden" states:

A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden. ..... The default value for this property is NO. You might use this property to hide views that are covered by the arrival of a new view. In this case, the hidden views might remain visible onscreen, but they are not the focus of the user’s actions.

You might also use this property to hide a transient view that VoiceOver users don’t need to notice. For example, VoiceOver doesn’t need to describe the translucent view that appears when users adjust the volume on their devices, because the aural feedback of this action is sufficient.

So based on this, in order to have those subviews ignored by VoiceOver, you'd actually want to set this to "YES" on the parent view.

like image 40
nickbona Avatar answered Oct 05 '22 19:10

nickbona