问题描述
我正在为视障人士开发报纸、杂志和书籍阅读应用.该应用程序的用户希望 VoiceOver 一次读取 UITextField 中的文本一个段落,而不是一次性阅读所有内容.如何实现?
I'm developing a newspaper, magazine and book reading app for the visually impaired. Users of the app want VoiceOver to read the text in the UITextField a paragraph at a time and not read everything in one go. How can this be accomplished?
推荐答案
这其实很简单.任何时候你有一个新的段落,使用一个新的 UITextField
视图.这会导致默认"行为一次扫描一段文本,非常直观.同时仍然允许逐行"转子设置一次作为一行运行.UIAccessibilityReadingContent
协议解决不了的问题.
This is very simple actually. Any time you have a new paragraph, utilize a new UITextField
view. This causes the "default" behavior to be scanning one paragraph of text at a time, which is very intuitive. While still allowing the "Line by Line" rotor setting to function as one line at a time. Which the UIAccessibilityReadingContent
protocol would solution would not do.
注意:实现与多个 UITextFields
相同效果的另一种方法是利用 UIAccessibilityContainer
协议通过 VoiceOver 创建合成的无障碍视图场景.将一个较大的 UITextField
容器转换为多个 UIAccessibilityElements
以用于辅助功能.
NOTE: Another way to accomplish the same effect as multiple UITextFields
is to utilize the UIAccessibilityContainer
protocol to create synthetic Accessibility Views only scene by VoiceOver. Turning your one larger UITextField
container, into multiple UIAccessibilityElements
for accessibility purposes.
不过,如果你有分页行为,你应该利用这个协议的分页特性.这将允许用户一次一页地阅读您的多个 UITextFields
集合.
Though, if you have paging behavior, you SHOULD utilize the paging feature of this protocol. THIS would allow a user to read your collection of multiple UITextFields
one page at a time.
总而言之,这种方法允许用户:
To summarize, this approach allows users to:
- 一次阅读一页(使用
UIAccessibilityReadingContent
) - 一次阅读一个段落(默认行为,每个
UITextField
一个段落) - 一次读取一行(转子:逐行)
- 此外,其他转子设置(单词和字符)
对我来说似乎很可靠!
这篇关于UITextView 中的 VoiceOver:一次阅读段落的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!