简体   繁体   中英

UISlider accessibility traits for VoiceOver?

What are are the proper UIAccessibility traits and handlers required to make a UISlider usable with VoiceOver enabled?

Are there any descriptions of how a user might use a UISlider with VoiceOver enabled?

Here's what I ended up adding to a UISlider for VoiceOver accessibility:

[ mySlider setIsAccessibilityElement:YES ];
[ mySlider setAccessibilityLabel:@"This slider controls blah blah etc...." ];

And in the target method for the control event UIControlEventValueChanged:

[ mySlider setAccessibilityValue = [ NSString stringWithFormat:@"Blah blah is set to %3.1f", mySlider.value];

With VoiceOver enabled, this slider then spoke the new value as I swiped up and down (not back and forth) over it after setting the focus to that slider.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM