Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving Accessibility Voiceover cursor focus to a specific element

I'm having an issue with moving the voiceover cursor to a specific element on viewDidAppear. I followed Apple's guidelines for focusing on a specific element, in this case a dismiss button, but the cursor ends up elsewhere

Here is my Code:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification,
                                self.dismissButton);
}

Any help, ideas, would definitely be appreciated! thank you so much.

like image 726
3254523 Avatar asked Jan 06 '14 21:01

3254523


People also ask

What is VoiceOver rotor?

VoiceOver rotor Using the rotor is an easy way to hear, for example, all the links on a page. It can also be used to move quickly to a particular place on a website, such as a specific heading or landmark. The types of items that appear in the rotor can be changed in the VoiceOver Utility > Web > Web Rotor.

What is VoiceOver screen reader?

Android - TalkBackTalkBack is the Google screen reader included on Android devices. TalkBack gives you spoken feedback so that you can use your device without looking at the screen. You can drag one finger around the screen and TalkBack announces the icons, buttons, and other items as you drag your finger over them.


2 Answers

This answer may be of help.

Basically you need to wrap your elements in a container view if they're not in one already and then override the methods specified.

By giving your desired element a tag that is lower than the other elements you can have the view sort the array to ensure that it will be the first element in the accessibilityElements array used by VoiceOver. Or you can adapt the sort method to sort another way.

like image 125
josef Avatar answered Sep 21 '22 03:09

josef


If I remember correctly i was not able to reliably focus on elements on first of the view as VO will generally focus on the top of the view.

The code you are doing is correct, but at this point the system will trigger it's own event and override yours.

What you can try to do is post a notification with a delay. But that will result in focus jumping around a little bit when opening the view.

It's not much of an answer, but that is where I'm at at the moment. I'll update you if I figure out a way to do it.

like image 34
Feras Arabiat Avatar answered Sep 21 '22 03:09

Feras Arabiat