2

There are 2 answers on SO concerning this, but neither seem to work any longer.

I have a custom UITableViewCell. There are various labels laid out on this cell. VoiceOver for Accessibility reads things Left to Right, Top to Bottom.

This is an issue for the layout of my cell. I need things to be read in a specific order.

However, I don't seem to be able to change the order in which VoiceOver reads things by default.

I've tried self.accessibilityElements = @[self.view5, self.view1, self.view9] for example, but this does not change order.

chris P
  • 6,359
  • 11
  • 40
  • 84

2 Answers2

0

You can set the cell's accessibility label with the string that you create combining all cell's subviews, for example if you have lbl1, lbl2, lbl3, btn1:

    NSString *cellAccessibilityString = [NSString stringWithFormat:@"%@,%@,%@,%@", _lbl3.text, _lbl2.text, _btn1.text, _lbl1.text];
    [self setAccessibilityLabel:cellAccessibilityString];

Where "self" is the cell.

Vadim F.
  • 881
  • 9
  • 21
-2

No, Voice over doesnt work like that. You cannot change the order of the accessibility elements. YOu can only skip some elements which are in the stack.

Let's say you have views 1 to 9 in a vertical layout

and you do this:

     self.accessibilityElements = @[self.view5, self.view1, self.view9]

IT doesnt mean that accessibility will read view 5 first, and then view 1 and then view 9.

YOu should give the order like:

      self.accessibilityElements = @[self.view1, self.view5, self.view9]

So that the voice over only reads them in the order 1,5,9, and it skips the remianing!!!!

Again the voice over reads in the order left to right and from top to bottom!!!

Think it like this: USe self.accessibilityElements only if you want to add/skip the accessibility for the elements in your view, but not for the accessibility order!!!

Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
  • I'm assuming this is intentional then by Apple? Not allowing accessibility element re-ordering? Voice over reads LtoR, TtoB, standardized across all views so that those who use VoiceOver understand exactly where the element is in the given space. This makes sense as Apple's HIG is full of standards like this that must be followed. However, I'm curious. What do you think about this answer (http://stackoverflow.com/questions/13279498/change-order-of-read-items-with-voiceover) to this question? It sounds like it can be done, but with the amount of workaround it requires, it sounds like maybe it.. – chris P Nov 11 '15 at 14:47
  • I seen the accessibility testing many times . Every time the accessibility focus should be top to bottom and left to right manner. If you chnage the focus order, it may cause confusion to blind people. They always believe focus will move from left to right and top to bottom. Though I got the idea to chnage the focus order , I was not encouraged to implement such kind of behaviour – Teja Nandamuri Nov 11 '15 at 14:52
  • If you are not targeting blind people, you may try this. I will try to implement that solution and see if it really works or not. I will come back later and update the answer with the results – Teja Nandamuri Nov 11 '15 at 14:54
  • any good findings? The cell I want to do it on, isn't actionable. The user cannot interact with any of the particular items. It's literally just a context/view/readonly style cell. It would be nice to have things read in a certain order for this particular cell. – chris P Nov 11 '15 at 22:28