Default UIAccessibilityElement after screen change

倾然丶 夕夏残阳落幕 提交于 2021-01-27 18:20:25

问题


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

UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, element);

but with no success.


回答1:


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 : 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.

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



来源:https://stackoverflow.com/questions/12807468/default-uiaccessibilityelement-after-screen-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!