How can I make a UITableView with big header VoiceOver compatible?

冷暖自知 提交于 2019-12-01 11:43:35

问题


My app has a table view with a large, blank tableHeaderView allowing to scroll the visible cells completely out of the window (to the bottom). So a contentOffset of {0,0} means, the content is scrolled out of the window. The initial contentOffset is {0,{height of tableView}}.

This all works fine but I'm having a hard problem to enable accessibility for it.

The user steps through the elements, starting with the navigation bar and its bar buttons. As soon as she swipes again to activate the first cell of the table view, the table view automatically scrolls to {0,0}. However, since the first cell isn't visible at this contentOffset, it fails to focus on it and keeps the focus on the last selected element.

Can I somehow prevent this or control the contentOffset in VO mode manually?

I created a demo project showing my problem.


回答1:


If there is no accessible content in the empty header, consider setting the content offset programmatically upon load in the event that UIAccessibilityIsVoiceOverRunning(). You will also want to monitor for UIAccessibilityVoiceOverStatusChanged and do the same.



来源:https://stackoverflow.com/questions/39603917/how-can-i-make-a-uitableview-with-big-header-voiceover-compatible

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