Moving Accessibility Voiceover cursor focus to a specific element

3254523 picture 3254523 · Jan 6, 2014 · Viewed 15.1k times · Source

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.

Answer

Feras Arabiat picture Feras Arabiat · Jan 13, 2014

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.