livings124
livings124

Reputation: 1113

iOS Accessibility: make UITextField and specified subview accessible

I want to make a textfield and a subview on the text field accessible by VoiceOver. If I use UIAccessibilityContainer methods, I can only make the subviews accessible. Is there some way to do this?

Upvotes: 8

Views: 3916

Answers (2)

Rakesh iOS Dev
Rakesh iOS Dev

Reputation: 955

try this,

textfield.isAccessibilityElement = YES;

textfield.accessibilityElementsHidden = NO;

Leave the container methods for time being.

Upvotes: -1

Justin
Justin

Reputation: 20609

No. You must go up one level in the accessibility hierarchy. Implement the container protocol on your view's superview and return all of its descendants as children (and, thus, siblings of each other).

Upvotes: 5

Related Questions