Override VoiceOver message in UITextField - iOS Accessibilty

I have a UITextField that contains "24 hours a day", but I want the voiceover to say "24 euros a month". By setting:

[textView setAccessibilityLabel:@"£24 per month"];

      

VoiceOver reads "£ 24 a month for 24 hours."

How can I disable a message in a UITextField?

+3


source to share


2 answers


You must set an accessibility label to describe the text field (as if it were a key) and an accessibility value for its value.

textField.accessibilityLabel = NSLocalizedString(@"Price", nil);
// textField.accessibilityValue = @"£24 per month";
textField.accessibilityValue = [self transformedPrice:textField.text];

      



-transformedPrice:

should do any operation to convert the actual text in your textbox to what should be used when transmitting voice. (Don't forget to localize)

+3


source


Set accessibilityValue

to nil

or an empty string and accessibilityLabel

- @"£24 per month"

.



+1


source







All Articles