简体   繁体   English

Swift - 禁用辅助功能画外音?

[英]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.

相关问题 Swift-TableViewCell可访问性(VoiceOver) - Swift - TableViewCell Accessibility (VoiceOver) 如何使用 Swift 在 Mac OS 的 NSTableView 上禁用辅助功能画外音 - How to disable accessibility voiceover on NSTableView for Mac OS using Swift Swift 如何通过可访问性 VoiceOver 引擎了解当前聚焦的对象 - Swift how to know currently focused object by accessibility VoiceOver engine swift-ios- Accessibility - 首先将 Voiceover 阅读/焦点顺序更改为内容视图然后导航项目? - swift-ios- Accessibility - change Voiceover read/focus order to content view first then the navigation items? 辅助功能VoiceOver在UILabel上不起作用 - Accessibility VoiceOver does not work on a UILabel 使用`accessibilityLabel`和`accessibilityHint`在iOS中正确实现VoiceOver可访问性 - Correct implementation of VoiceOver accessibility in iOS with `accessibilityLabel` and `accessibilityHint` Swift 中带有 UISegmentedControl 的 VoiceOver - VoiceOver with UISegmentedControl in Swift 如何控制 SwiftUI 图像的辅助功能配音文本 - How to control accessibility voiceover text for the SwiftUI Image VoiceOver可访问性不适用于OOB UITableView滑动操作 - VoiceOver accessibility not working with OOB UITableView swipe actions 如何更改 swift 中的 VoiceOver 发音? - How to change the VoiceOver pronunciation in swift?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM