VoiceOver:如何在计算器中实现与按键类似的按钮 [英] VoiceOver: how to implement button that behaves like keys in Calculator

查看:31
本文介绍了VoiceOver:如何在计算器中实现与按键类似的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在使用 VoiceOver 时将注意力集中在计算器应用程序中的数字键上(通过轻点一次、在其上滑动手指或向左/向右滑动),VoiceOver 会播报按钮标题.然后,如果您通过双击激活"按钮,它会按下按钮,VoiceOver 会以比按钮标题通知更高的音调读出插入到计算器显示中的字符.

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.

推荐答案

当用户调用您的控件的操作时,重写 accessibilityActivate 方法以执行某些操作.

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

这篇关于VoiceOver:如何在计算器中实现与按键类似的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆