发布屏幕更改通知后,如何控制哪个UIAccessibilityElement获得焦点? [英] How to control which UIAccessibilityElement receives focus after posting screen change notification?

查看:278
本文介绍了发布屏幕更改通知后,如何控制哪个UIAccessibilityElement获得焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有辅助元素的覆盖层。当它消失时,我发布 UIAccessibilityScreenChangedNotification 导致VoiceOver更新。

I have an overlay with accessible elements. When it disappears, I post UIAccessibilityScreenChangedNotification to cause VoiceOver update.

VoiceOver然后选择屏幕的第一个元素。在发布 UIAccessibilityScreenChangedNotification 之后,如何默认使它集中于特定元素?

VoiceOver then picks first element of the screen. How can I make it focus on a specific element by default after posting UIAccessibilityScreenChangedNotification?

推荐答案

发布通知时,您可以提供其他信息,这些信息可以是 VoiceOver 所说的 NSString 对象,或者 VoiceOver 移动到的可访问性元素。

When you post the notification you can supply additional information which is either an NSString object that VoiceOver speaks or an accessibility element that VoiceOver moves to.

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, focusItem);

这篇关于发布屏幕更改通知后,如何控制哪个UIAccessibilityElement获得焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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