Is it possible to change the order in which the VoiceOver feature for accessibility in iPad reads out the elements, when the 'Two-finger Flick Down' gesture is done?
For the attached image, which contains 3 labels and a button, the VoiceOver reads the elements in the following way,
Label 1 -> Label 2 -> Button -> Label 3
Can the order be changed to,
Label 1 -> Label 2 -> Label 3 -> Button
To turn on VoiceOver, we'll go to our Settings -> General -> Accessibility -> VoiceOver. Slide the VoiceOver toggle to turn that functionality on. And there we go! To slow down or speed up VoiceOver you can click on the “Speaking Rate” range, and swipe up or down to increase or decrease speed.
With VoiceOver—a gesture-based screen reader—you can use iPhone even if you can't see the screen. VoiceOver gives audible descriptions of what's on your screen—from battery level, to who's calling, to which app your finger is on. You can also adjust the speaking rate and pitch to suit your needs.
You can use the VoiceOver rotor to change how VoiceOver works. You can adjust the VoiceOver volume or speaking rate, move from one item to the next on the screen, select special input methods such as Braille Screen Input or Handwriting, and more.
The quickest way to achieve this for your example is to place the three labels in a transparent UIView
subclass to serve as a container for your labels. This subclass will have to be properly setup to let VoiceOver know how to interpret it. If your deployment target is iOS6
then you can simply answer the "should group accessibility children" question in this subclass.
-(BOOL)shouldGroupAccessibilityChildren{
return YES;
}
For below iOS6
it would be more complicated, except that your UIView
container subclass would contain only UILabels
which are accessibility elements. You could implement it like this:
-(BOOL)isAccessibilityElement{
return NO;
}
-(NSInteger)accessibilityElementCount{
return self.subviews.count;
}
-(id)accessibilityElementAtIndex:(NSInteger)index{
return [self.subviews objectAtIndex:index];
}
-(NSInteger)indexOfAccessibilityElement:(id)element{
return [self.subviews indexOfObject:element];
}
I have tested this example code and it does what you are looking for, if you need any clarification please add a comment. Always happy to help make things more accessible.
I tried setting the shouldGroupAccessibilityChildren
to YES
but it didn't work for me.
What did work for me was setting the accessibility label of the parent view directly (because I wanted all the items to be read in one go/one VoiceOver gesture).
[cell setAccessibilityLabel:[NSString stringWithFormat:@"%@, %@", cityLabel, temperatureLabel]];
The above snippet of codes is from Apple's documentation Enhancing the Accessibility of Table View Cells
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With