3

I have an app that contains a view with a cell that uses the built-in cell.textLabel and a custom UITextField in cell.contentView.

I am working with Voiceover and accessibility and the desired behavior would be that whenever I tap anywhere in the cell, the accessibility element for the UITextField would be selected.

The behavior that I am actually seeing is that the cell.textLabel accessibility labels are taking over. When I don't have cell.textLabel set to anything, everything works as expected. I have also attempted to set the "isAccessibilityElement" property with no luck:

[cell.textLabel.text setIsAccessibilityElement:NO];

Does anyone know how to make this work the way I want?

amundsnw
  • 191
  • 2
  • 8
  • 4
    The text is never an accessibility element to begin with (it's just a string). Did you mean `[cell.textLabel setIsAccessibilityElement:NO];`? – David Rönnqvist May 01 '13 at 14:28
  • 4
    Do you want to restrict user interaction on your cell.textLabel? correct me if i am wrong. – Dilip Manek May 01 '13 at 14:46
  • Sorry - yes , I did mean: `[cell.textLabel setIsAccessibilityElement:NO];` It still didn't disable the accessibility element for the textLabel – amundsnw May 01 '13 at 15:09
  • @Dilip - I'm not so worried about restricting user interation on the cell.textLabel, as the user already can't change anything there. I'm more concerned about disabling the accessibility element for the label. I have also tried to explicitly disable user interaction to no avail: ` [cell.textLabel setUserInteractionEnabled:NO];` – amundsnw May 01 '13 at 15:22

1 Answers1

4

I was able to figure this out using this: cell.textLabel.accessibilityElementsHidden = YES;

amundsnw
  • 191
  • 2
  • 8