我在我的导航栏中有一个自定义按钮。
在Interface Builder中,使用Bar Buttons无法编辑辅助功能,因此我在代码中进行了编辑:
self.addressBookButton.isAccessibilityElement = YES;
self.addressBookButton.accessibilityLabel = @"Contacts";
self.addressBookButton.accessibilityHint = @"Selects a phone number.";
在模拟器和设备上,VoiceOver只会忽略提示,并仅发音标签:
"联系人,按钮。"
accessibilityHint
属性没有被使用。我无法让它正常工作,而且标准的苹果应用程序并没有在栏按钮上添加提示。您可以尝试创建一个普通的UIButton,添加一个提示,然后使用initWithCustomView:
方法。(我不确定是否有效。) - Aaron Brager