Is there any way to set accessibilityHint for back button? I would like that voiceover read first
"Back Button" and after this Hint e.g. "Double tap to go back to select a building screen"
I'm trying to do it that way but it's not working:
in viewDidLoad:
[super viewDidLoad];
// back button without any text just back arrow
UIBarButtonItem *backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@""
style:UIBarButtonItemStylePlain
target:nil
action:nil];
self.navigationItem.backBarButtonItem = backBarButtonItem;
self.navigationItem.backBarButtonItem.accessibilityHint = @"Double tap to go back to select a building screen";
Just set accessibility label and not accessibility hint.
self.navigationItem.backBarButtonItem.accessibilityLabel = @"Back Button, Double tap to go back to select a building screen";
Instead of using
backBarButtonItem
, use ofleftBarButtonItem
should be the trick.Try the code below in your view controller that displays the back button :
Now, you have only an arrow for the back button and you can add whatever desired accessibility label or hint.