VoiceOver:强制在屏幕转换后选择辅助功能元素 [英] VoiceOver: force an accessibility element to be selected after a screen transition

查看:35
本文介绍了VoiceOver:强制在屏幕转换后选择辅助功能元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在让我的 iOS 应用程序可访问,我快完成了.我的应用程序包含多个自定义屏幕转换,当 VoiceOver 开启时,它似乎选择最左上角的元素在转换后进行描述,或者偶尔选择一个随机元素.UIAccessibilityTraitSummaryElement 看起来很有前途,但据我所知,它仅在应用启动时有效,而不是在任意转换后有效.

I'm in the process of making my iOS app accessible and I'm nearly finished. My app contains several custom screen transitions, and when VoiceOver is on it seems to pick either the top-leftmost element to describe after the transition or, occasionally, a random element. UIAccessibilityTraitSummaryElement looked promising but as I understand it only works when the app is started, not after arbitrary transitions.

似乎没有可访问性特征或属性来指定元素获得 VoiceOver 焦点的首选顺序.有没有办法强制 VoiceOver 聚焦?

There doesn't seem to be an accessibility trait or property to specify the preferred order that elements are given VoiceOver focus. Is there any way to force VoiceOver focus?

推荐答案

iOS 6 现在可用,正如 kevboh 所提到的,您现在可以在发布 时传递参数UIAccessibilityLayoutChangedNotificationUIAccessibilityScreenChangedNotification:

iOS 6 is now available, and as mentioned by kevboh, you can now pass an argument when posting a UIAccessibilityLayoutChangedNotification or UIAccessibilityScreenChangedNotification:

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, myAccessibilityElement);

myAccessibilityElement 在大多数情况下是一个 UIView,isAccessibilityElement 设置为 YES(许多视图的默认设置).

myAccessibilityElement will in most cases be a UIView with isAccessibilityElement set to YES (the default for many views).

或者,您可以将 iOS6 UIAccessibilityTraitHeader 中添加的新特征添加到您的辅助功能元素的 accessibilityTraits 中,这应该具有相同的结果(尽管我没有对此进行测试)还).

Alternatively, you could add the new trait added in iOS6 UIAccessibilityTraitHeader to your accessibility elements' accessibilityTraits, which should have the same result (although I didn't test this yet).

原文:iOS 6 中的新 API 无法在此处讨论,因为它仍处于保密协议之下,但可以在 WWDC 2012(Session 210)的iOS 辅助功能"视频中找到).

ORIGINAL: There's new API in iOS 6 that can't be discussed here because it is still under NDA, but can be found in the "Accessibility for iOS" video of WWDC 2012 (Session 210).

如果失败,解决方法可能是手动触发公告以覆盖默认的聚焦辅助功能标签公告:

Failing that though, a workaround could be to manually trigger a announcement to override the default focused accessibility label announcement:

UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, @"Your text");

这篇关于VoiceOver:强制在屏幕转换后选择辅助功能元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆