即使双击按钮,VoiceOver 也会读取标签

VoiceOver reads Label even when button is double-tapped

我已经为我的 UIButton 设置了自定义提示。我期望的是单击时,按钮会读取提示;双击提示时不会发出声音,但会发生正常的按钮操作。

但实际上,双击会再次读取提示,同时会发生正常的按钮操作。重新阅读会很烦人,但正常的动作是播放不同的声音。他们最终被结合在一起。耶!

有人会认为 UIAccessibilityTraitPlaysSound 会是要使用的东西,但它没有任何效果。我可以只使用 AllowsDirectInteraction,但会丢失提示。无论如何,重新阅读双击提示是错误的。恕我直言。

如果我没记错的话,plays sound 特性指的是激活声音(听起来像一个简短的 "blip"),用于想要播放自己的激活声音的元素。

如果您播放的不是激活声音 more/longer,我认为您应该使用 starts media session trait。

UIAccessibilityTraitStartsMediaSession 

The accessibility element starts a media session when it is activated.

You can use this trait to silence the audio output of an assistive technology, such as VoiceOver, during a media session that should not be interrupted. For example, you might use this trait to silence VoiceOver speech while the user is recording audio.