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.
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.
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.
The "memorized" part makes me think you aren't doing something like UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil)
after removing the subviews.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With