VoiceOver accessibility label for Touch ID

后端 未结 3 560
情歌与酒
情歌与酒 2021-01-21 00:42

I am trying to ensure that the iOS app that I am working on is accessible and am trying to implement VoiceOver to ensure this.

One strange thing that I cannot find any h

相关标签:
3条回答
  • 2021-01-21 01:19

    You should definitely not change the accessibility label just to make VoiceOver pronounce things correctly (i.e. do not try "hack" the label pronounciation). The reason is that VoiceOver does not have speech output only; it has also braille output where blind users expect to read things exactly letter-by-letter as they are written (i.e. see exactly all the spaces, capital/small letters, etc.) If you did e.g. write "I D" instead of "ID", then while VoiceOver would pronounce it perhaps correctly (in the specific version of iOS), blind users, after also reading "I D" on a braille display might think that that is how it is actually written and appear let's say non-professionally when they would then use this wrong spelling in written exchanges with other people.

    The correct way to deal with this, albeit without giving you an immediate solution, is:

    1. File a bug with Apple about pronounciation of the specific word with the specific voice in the specific language (e.g. "Expected pronounciation: [aj'di:]" vs. "Actual pronounciation: [id]")
    2. File a bug with Apple to request the ability to customize pronunciation only (i.e. where you would leave the accessibility label intact and correct, but specify to the voice how it should pronounce certain part of the text), and where this customization could be done for each language individually by the translator translating the strings (because wrong pronunciation is language-specific) - also see the next point.
    3. If you can reword, try different word than the problematic one (which seems not applicable in case of "Touch ID" which is a set term). But this is a hack too, as that solves only the English original and does not care about translations where the rewording might on the contrary potentially complicate the pronunciation.

    Sorry for the bad news.

    Finally, here, both on iOS 8.4.1 and iOS 9.0.2, VoiceOver with default US English iOS voice, at least on this webpage, pronounces "ID" in "Touch ID" as [ajdi:], not [id].

    0 讨论(0)
  • 2021-01-21 01:28

    You can try this for a quick work around: Just give space between I and D

      NSString *label = @"Please authenticate your ID using the Touch ID";
      label.accessibilityLabel=@"Please authenticate your I D using the Touch I D";
    

    Also please note that you can only set accessibility to UIElements and you cannot set it to general variables. It doesn't make sense to set accessibility label for LAContext and to NSString.

    YOu need to set the accessibility label to UILabel or the element which you give the NSString to.

    0 讨论(0)
  • 2021-01-21 01:28

    Starting with iOS 11, you can set the element's accessibilityAttributedLabel and use the UIAccessibilitySpeechAttributeIPANotation key (Swift: NSAttributedString.Key.accessibilitySpeechIPANotation) to specify the pronunciation for a range of the attributed string.

    See "Speech Attributes for Attributed Strings" for other tools you can use to tweak how VoiceOver reads your text.

    0 讨论(0)
提交回复
热议问题