如何使 UITableView 与大标题 VoiceOver 兼容?

How can I make a UITableView with big header VoiceOver compatible?(如何使 UITableView 与大标题 VoiceOver 兼容?)
本文介绍了如何使 UITableView 与大标题 VoiceOver 兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个表格视图,其中有一个大的空白 tableHeaderView 允许将可见单元格完全滚动到窗口之外(到底部).所以 {0,0} 的 contentOffset 意味着内容被滚动出窗口.初始 contentOffset 为 {0,{height of tableView}}.

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.

用户逐步浏览元素,从导航栏及其栏按钮开始.只要她再次滑动以激活表格视图的第一个单元格,表格视图就会自动滚动到 {0,0}.但是,由于第一个单元格在此 contentOffset 处不可见,因此无法聚焦在它上,而是将焦点保持在最后一个选定的元素上.

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.

我可以以某种方式阻止这种情况或手动控制 VO 模式下的 contentOffset 吗?

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

我创建了一个演示项目来显示我的问题.

I created a demo project showing my problem.

推荐答案

如果空标题中没有可访问的内容,请考虑在加载时以编程方式设置内容偏移量,以防 UIAccessibilityIsVoiceOverRunning().您还需要监控 UIAccessibilityVoiceOverStatusChanged 并执行相同操作.

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.

这篇关于如何使 UITableView 与大标题 VoiceOver 兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)