考虑将 KIF 添加到我们的应用程序以进行集成测试。我希望能够从 UIActionSheet 中选择一个按钮,但似乎没有一种有效的方法来为操作表中的每个按钮设置辅助功能标签。
我正在考虑使用 accessibleElementCount,以这种方式遍历按钮。这是执行此操作的首选方法还是有更标准的方法来设置 UIActionSheets 的可访问性?
最佳答案
来自UIKit User Interface Catalog :
Action sheets are accessible by default.
Accessibility for action sheets primarily concerns button titles. If VoiceOver is activated, it speaks the word “alert” when an action sheet is shown, then speaks its title if set (although iOS human interface guidelines recommend against titling action sheets). As the user taps a button in the action sheet, VoiceOver speaks its title and the word “button.”
从您的问题来看,您不清楚是否要将可访问性标签更改为按钮标题 + 按钮以外的其他内容,但看起来这不可能以直接的方式进行。
关于iphone - 在 UIActionSheets 上设置辅助功能标签的首选方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21008043/