I am trying to get the value "HELLO"
of the UILabel
shown in the iPad simulator.
I have enabled accessibility and have set the label as "Label Access"
.
But when I call target.logElementTree()
, both the name and value are set to "LabelAccess"
and as far as the apple docs say, the value field should contain the string that is set (in this case "Hello"
).
Does anybody know a fix for this?
PS: I am using the latest iOS SDK and Xcode. Apple Stack Exchange
I think you encountered a UIAutomation bug that exists since forever.
Easiest way to get around this bug is to set the accessibilityValue to your text in code.
Something like this.
NSString *valueString = [NSString stringWithFormat:@"%d", value];
self.label.text = valueString;
self.label.accessibilityValue = valueString;
Helps those people that use Voice Over too ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With