有没有办法在iOS应用程序的VoiceOver中更改默认辅助功能操作的文本?

时间:2016-12-28 06:21:00

标签: ios objective-c voiceover uiaccessibility

我在我的应用中为VoiceOver用户添加了一些辅助功能自定义操作,但默认情况下会显示“激活项目,默认操作”。

通过使用转子,VoiceOver用户将转子项目更改为操作,然后执行注册的自定义操作(如删除或共享项目)。但他们的默认操作是“激活项目”。有没有办法改变这个文本?我想要它说“玩这个项目”。或者如果我可以禁用默认操作,它也适用于我。

UIAccessibilityCustomAction *action1 = [[UIAccessibilityCustomAction alloc] initWithName:@"double tap to share" target:self selector:@selector(voiceOverActionShare)];
UIAccessibilityCustomAction *action2 = [[UIAccessibilityCustomAction alloc] initWithName:@"double tap to view more info" target:self selector:@selector(voiceOverActionMoreInfo)];
UIAccessibilityCustomAction *action3 = [[UIAccessibilityCustomAction alloc] initWithName:@"double tap to add to my list" target:self selector:@selector(voiceOverActionAdd)];
UIAccessibilityCustomAction *action4 = [[UIAccessibilityCustomAction alloc] initWithName:@"double tap to play" target:self selector:@selector(voiceOverActionPlay)];

这是我添加辅助功能自定义操作的方法。但我得到五个动作,因为他们有默认动作,表示“激活项目,默认动作”。我可以改变它说话的方式吗?我希望它像“玩这个项目”一样说。

1 个答案:

答案 0 :(得分:0)

我找不到任何方法来阻止读取默认操作(iOS 10.2)。您可以考虑在bugreport.apple.com提交增强请求。

旁注: 您的问题可能已经发现VoiceOver中的错误。设置UIAccessibilityTraitNotEnabled(相当于禁用和调暗控件)会阻止调用acccessibilityActivate(),但仍允许您触发其他自定义操作。我已经提交了一份错误报告(rdar:// 29941588)。

相关问题