-->

VoiceOver: how to implement button that behaves li

2019-05-30 23:42发布

问题:

When you focus on a digit key in the Calculator app when using VoiceOver (either by tapping it once, sliding a finger over it, or by swiping left/right to it), VoiceOver announces the button title. Then if you "activate" the button by double tapping, it presses the button and VoiceOver announces the character that was inserted into the Calculator display with a higher pitch than the button title announcement.

My question is: how can I get the same behavior for buttons in my app - repeat the button title in a higher pitch upon activating the button?

I've set the accessibility traits to Keyboard Key. I've tried to post an announcement notification but that announcement is not in a higher pitch.

回答1:

Override the accessibilityActivate method to perform certain actions when the user has invoked the action of your control.