Can I influence what appears in the VoiceOver rotor?

我怕爱的太早我们不能终老 提交于 2019-12-24 05:53:05

问题


I have a text based app where I want my users to make use of the 'Lines' rotor option when VoiceOver is enabled. However the option doesn't appear. The text in my app is laid out using cells in a tableview (the cells contain UILabels and other views).

I'm afraid my implementation affects how the rotor is "seeing" my app, but I think it's unfortunate if it limits me from supporting the rotor fully.

Is there any way I can make use of the 'Lines' option in the rotor?


回答1:


I think you are looking for the UIAccessibilityReadingContent protocol.

The UIAccessibilityReadingContent protocol can be implemented on an object that represents content that is intended to be read by users, such as a book or an article.

There are four methods to implement:

  • accessibilityLineNumberForPoint:
  • accessibilityContentForLineNumber:
  • accessibilityFrameForLineNumber:
  • accessibilityPageContent

You are going to have to figure out how to cut the text into lines, the frame of each line and what line a certain point belongs to (hit testing) but since you are using table views you should be able to hook into the frames of the cells to figure out those things.



来源:https://stackoverflow.com/questions/22793032/can-i-influence-what-appears-in-the-voiceover-rotor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!