简体   繁体   中英

Enable VoiceOver on the view and it subviews

Background : Like the voicemail view inside Apple's Phone app. I want to be able to get voiceover announcement from the cell context as well as the individual controls.

Problem : It seems that if the parent view has the accessibility turned on, the subviews become non-accessible.

I looked into shouldGroupAccessibilityChildren and accessibilityViewIsModal but they don't seem to solve it. I think UIAccessibilityNavigationStyle might be the answer but not sure how to use it.


Clarification : This has nothing to do with visual voicemail. Below shows the picture of the Apple's native app with voice over on. The black box is where the target of the voice is. The green box just blocks out some private info.

When select the overall box 在此处输入图片说明

When select the play button 在此处输入图片说明

You should look into subclassing the UIAccessibilityContainer protocol. I believe this is what you want. Create a custom accessibility container that is the parent for all of the things that you want. You then have more fine grained control over how your super view, and it's children, get reported to the accessibility APIs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM