使VoiceOver可以访问UITableView中的动态更新内容 [英] Making dynamically updating content in a UITableView accessible for VoiceOver

查看:112
本文介绍了使VoiceOver可以访问UITableView中的动态更新内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使我的应用程序更易于访问,到目前为止,诸如标签和提示之类的标准可访问性都在创造奇迹.但是,我遇到了动态更新UITableView中显示的内容的问题.

I'm trying to make my app more accessible and so far the standard accessibility things like labels and hints are doing wonders. I'm hitting a problem however with dynamically updating content that's displayed in a UITableView.

表的每一行大约每秒钟更新一次,但是如果我此时尝试创建每个单元格的accessibilityLabel,那么我会发现VoiceOver出现问题,因为选定的标签不断变化,因此VoiceOver读出所选标签会不断打扰自己因此,系统只是从头开始读取标签内容(实际上,一个奇怪的怪癖表明,有时对于选定的第一个单元格,语音正常工作,但是在选择新的单元格时,此错误会返回).

Each row of the table updates every second or so, but if I try to create each cell's accessibilityLabel at this point then I find that there is a problem with the VoiceOver reading out the selected label keeps interrupting itself as the label contents changes so the system just starts reading the label content from the beginning again (actually an odd quirk shows the voice over sometimes works correctly for the first cell that was selected, but upon selecting a new cell this bug returns).

我试图查看是否有任何方法可以尝试了解VoiceOver当前是否处于活动状态,但据我所知,只有VoiceOver完成时才会发布通知

I've tried to see if there's anyway to try and understand whether VoiceOver is currently active but as far as I can see there is only a notification posted when VoiceOver finishes

UIAccessibilityAnnouncementDidFinishNotification

VoiceOver何时开始没有等效的通知.因此,TableViewController无法知道VoiceOver当前处于活动状态,并且不应该更新任何accessibilityLabels.

There's no equivalent notification for when VoiceOver begins. So there's no way for my TableViewController to know that VoiceOver is currently active and that it shouldn't update any accessibilityLabels.

我希望我至少可以使用

accessibilityElementIsFocused

方法.但是,在所有测试中,我仍然无法看到针对自定义UITableViewCell的可靠触发.

method. However in all my testing I've not been able to see this reliably fire for a custom UITableViewCell.

我还尝试为我的自定义单元格实现accessibilityLabel的吸气剂,希望这可以起作用,但可悲的是,发生了相同的行为.

I also tried implementing the getter for accessibilityLabel for my custom cell hoping this may work, but sadly the same behaviour occurs.

我剩下的唯一解决方案是用户可配置的频率,用于动态内容可访问性更新,例如5、10、20秒...这可能阻止我更新标签,直到我知道最后更改的内容肯定会被读出.实际上,如果用户选择在最后一次更新后的8秒选择一个单元格,则在2秒内输入10秒钟的限制,标签也会更新,导致语音重新开始.

The only solution I'm left with is a user configurable frequency for dynamic content accessibility updates, say 5, 10, 20 seconds... which can block me updating my label until I know that the last changed content would have definitely been read out. Actually even this could be interrupted if the user chose to select a cell at say 8 seconds after the last update, 2 seconds in for a 10 second limit and the label would update causing the voice over to restart.

有人对如何最好地处理此动态更新内容有任何想法吗?我以为tableview单元会使事情变得有些复杂,但总的来说,我只是不了解Apple如何期望您处理动态内容.解决此问题所需要做的就是另一条通知

Has anyone any ideas of how best to handle this dynamic updating content? I'm presuming the tableview cells are complicating matters a little, but in general I just don't understand how apple expects you to handle dynamic content. All it needs to solve this is another notification

UIAccessibilityAnnouncementDidStartNotification

甚至更好的一种方法来查询VoiceOver当前是否处于活动状态.但我似乎找不到任何东西!

Or even better a method to enquire as to whether VoiceOver is currently active. But I don't seem to be able to find any!

感谢您抽出宝贵的时间,非常感谢您提供的所有提示.干杯!

Thanks for your time, would really appreciate any tips on this. Cheers!

推荐答案

您想做两件事.首先,您想利用频繁更新"特征.当内容打开时,这应该可以改善应用程序的行为.

You want to do two things. First you want to take advantage of the "Updates Frequently" trait. This should improve the behavior of the app when the content is on.

这应该有很大帮助.然后,您还需要为用户提供一种暂停更新内容的方法.无论您是否执行上述操作,这都是满足WCag 2.0准则2.2.2的绝对要求.

This should help a lot. Then you alse need to provide a way for user to halt the updating content. Independent of whether you do the above, this is an absolute requirement to satisfy WCag 2.0 guideline 2.2.2.

这篇关于使VoiceOver可以访问UITableView中的动态更新内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆