Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default UIAccessibilityElement after screen change

Is there any way to decide which element gets focus first? I tried use the second parameter in the following method

UIAccessibilityPostNotification(
    UIAccessibilityLayoutChangedNotification, 
    element
)

but with no success.

like image 787
Joris Weimar Avatar asked Feb 28 '26 19:02

Joris Weimar


1 Answers

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.

like image 58
XLE_22 Avatar answered Mar 03 '26 09:03

XLE_22



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!