[英]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.我看到在 xcode 7 上,在身份检查器下方,有一个可访问性部分(下图),我尝试取消选中该框,但似乎画外音和突出显示焦点功能仍然有效。 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.在为其创建了自定义可访问性的每个 SKNode 上,然后能够在 SKView -> 在 Storyboard 中选择适当的选项(再次参见屏幕截图)以允许游戏屏幕工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.