Reputation: 591
I have a UITextField that contains "£24 pm" but I want voiceover to say "£24 per month". By setting:
[textView setAccessibilityLabel:@"£24 per month"];
VoiceOver reads out "£24 per month £24 pm".
How do I stop the message in the UITextField from being read out?
Upvotes: 5
Views: 3931
Reputation: 11
Set the accessibilityValue
to nil
or a blank string and the accessibilityLabel
to @"£24 per month"
.
Upvotes: 1
Reputation: 4212
You should set the accessibility label to describe the text field (as if it was a key) and the accessibility value for its value.
textField.accessibilityLabel = NSLocalizedString(@"Price", nil);
// textField.accessibilityValue = @"£24 per month";
textField.accessibilityValue = [self transformedPrice:textField.text];
-transformedPrice:
should do whatever operation to transform the actual text in your textField to what should be used in voice over. (Don't forget localization)
Upvotes: 5