屏幕更改后的默认UIAccessibilityElement [英] Default UIAccessibilityElement after screen change

查看:97
本文介绍了屏幕更改后的默认UIAccessibilityElement的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以确定哪个元素首先获得关注?我尝试在

Any way to decide which element gets focus first? I tried use the second parameter in the

UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, element);

但没有成功.

推荐答案

使用UIAccessibilityPostNotification方法是

Using the UIAccessibilityPostNotification method is the proper way to get your purpose.

有几种类型的变更通知,但最常用的两种是:

There are several types of change notifications but the two most commonly used are :

  • UIAccessibilityLayoutChangedNotification :通知页面的一部分已使用2个可能的传入参数(NSString或UIObject)进行了更改. 使用NSString,通知的行为类似于具有VoiceOver语音的UIAccessibilityAnnouncementNotification. 使用UIObject,焦点将转移到用户界面元素上. 该通知与UIAccessibilityAnnouncementNotification非常相似,但应是由于动态内容被删除或添加到当前视图而引起的.
  • UIAccessibilityScreenChangedNotification :通知整个页面已更改,包括nil或UIObject作为传入参数. 如果设置为nil,则页面中的第一个可访问元素将被聚焦. 使用UIObject,焦点将通过VoiceOver转移到指定的元素. 此通知伴随着发声,包括宣布新页面的声音.
  • UIAccessibilityLayoutChangedNotification : notifies that a part of the page has changed with 2 possible incoming parameters (a NSString or a UIObject). With a NSString, the notification behaves like a UIAccessibilityAnnouncementNotification with a VoiceOver vocalization. With a UIObject, focus is shifted to the user interface element. This notification is very similar to the UIAccessibilityAnnouncementNotification but should come as a result of dynamic content being deleted or added to the current view.
  • UIAccessibilityScreenChangedNotification : notifies that the whole page has changed including nil or a UIObject as incoming parameters. With nil, the first accessible element in the page is focused. With a UIObject, focus is shifted to the specified element with a VoiceOver. This notification comes along with a vocalization including a sound like announcing a new page.

您的问题可能是您在代码行中指定的element类型,显然是因为它似乎完全正确.

Your problem may be the element type you specify in your line of code apparently because it seems perfectly correct.

这篇关于屏幕更改后的默认UIAccessibilityElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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