简体   繁体   中英

Swift - disable accessibility voiceover?

I was curious if there was a way to disable the voiceover accessibility (or any other type of accessibility feature for that matter - like hear aids, captioning, etc.) in swift?

Essentially, I'm trying to build an application that has a very high likelihood of being used by people with visual impairments and I've tailored my entire application for such people.

But given that this target group may have the voiceover accessibility feature on, can I disable that only within my application?

在此处输入图片说明

I see that on xcode 7, underneath the identity inspector, there is a section for accessibility (picture below) and I tried unchecking that box but it seems like voiceover and the highlighting focus feature are still in effect. Let me know if you have any suggestions or comments, thanks.

You can set

element.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction 

on any elements that you want to provide custom audio/interactions for.

This can also be accomplished in storyboard (See photo).

I came across this thread because I was trying to do this for on a game scene tucked inside of a view container. To get it to work, I was able to set

.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction

on each SKNode that had custom accessibility created for it, and then was able to select the proper options (again see screenshot) on the SKView -> View in Storyboard to allow the game screen to work.

辅助功能选项

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