实现自定义文本编辑器的辅助功能
我使用 Core Text 创建了一个自定义富文本编辑器并符合 UITextInput 协议。我正在尝试找出如何使其可供 VoiceOver 访问。
根据我对《辅助功能编程指南》和 UIAccessibility 协议及相关类的阅读,看起来我应该使我的自定义视图符合 UIAccessibilityContainer 协议,然后为文本创建 UIAccessibilityElements。我的问题是 - 我返回什么级别的文本粒度? UIAccessibilityElement 应该代表一行、一个单词、一个字符还是其他东西?
使用“笔记”应用程序,您可以选择线条、单词、字符等。 UIAccessibilityContainer/UIAccessibilityElement 似乎无法传达此信息。所以,我觉得我错过了一些东西。非常感谢任何建议或指示。
I've created a custom rich text editor using Core Text and conforming to the UITextInput protocol. I'm trying to figure out how to make it accessible to VoiceOver.
From my reading of the Accessibility Programming Guide and the UIAccessibility protocol and associated classes, it looks like I should make my custom view conform to the UIAccessibilityContainer protocol and then create UIAccessibilityElements for the text. My question is - what level of text granularity do I return? Should a UIAccessibilityElement represent a line, a word, a character, or something else?
Playing with the Notes app, it lets you select lines, words, characters, and more. UIAccessibilityContainer/UIAccessibilityElement seem to have no way to convey this information. So, I feel like I'm missing something. Any suggestions or pointers are very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使内容像 Notes 应用程序一样可读 - 您还必须为自定义视图实现 UIAccessibilityReadingContent 协议。这是参考iOSUIAccessibilityReadingContentReference
有关更多详细信息,请尝试查找 WWDC 2011 iOS 辅助功能视频。
To make the content readable like the Notes app has - you must also implement UIAccessibilityReadingContent Protocol for your custom view. This is a reference iOSUIAccessibilityReadingContentReference
For more details try to find the WWDC 2011 iOS Accessibility video.