如何在运行仅iPhone(非通用)应用程序的iPad上的UIPickerView中支持VoiceOver? [英] How do I support VoiceOver in UIPickerView on an iPad running an iPhone only app (non-universal)?

查看:133
本文介绍了如何在运行仅iPhone(非通用)应用程序的iPad上的UIPickerView中支持VoiceOver?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我会查看Apple的UICatalog示例代码,以获得基本的VoiceOver支持,但是示例代码中似乎有对UIPickerViews的VoiceOver支持。我是否需要在某处提供accessibilityLabel方法来添加VoiceOver支持?我尝试实施 UIPickerViewAccessibilityDelegate 方法,但画外音只能读取标签,而不是向上或向下滑动以更改值的提示。

Generally I look at Apple's UICatalog sample code for basic VoiceOver support however it looks like there is VoiceOver support for UIPickerViews in the sample code. Do I need to provide an accessibilityLabel method somewhere to add VoiceOver support? I tried to implement UIPickerViewAccessibilityDelegate methods but voice over only reads the labels in my picker view and not the hint to swipe up or down to change the values.

我的选择器视图也设置为UITextField的输入视图。所以我不确定这是否相关。

Also my picker view is set to the input view of a UITextField. So I'm not sure if that is relevant or not.

更新:
https://github.com/stevemoser/VoiceOverPicker

我创建了一个演示该问题的示例项目。在示例中,显示了一个普通的选择器视图和一个文本字段。还有一个选择器设置为文本字段的输入视图属性。我似乎无法仅在使用VoiceOver时通过点击任一选择器来激活它。虽然我可以通过在屏幕上的视图(向左和向右)滑动来激活任何一个。有任何想法吗?

I created a sample project demonstrating the issue. In the example there is a normal picker view shown and a textfield. There is also a picker that is set to the textfield's input view property. I can't seem to activate the either picker just by tapping on it while using VoiceOver. Though I can activate either one by swiping (left and right) through the views on screen. Any ideas?

更新2:
看起来该应用程序是运行在iPhone上的iPhone应用程序还是运行在iPad上的iPad应用程序,但工作正常,但如果它是在iPad上运行的仅iPhone应用程序,则点击以选择UIPickerView不起作用。

Update 2: Looks like if the app is an iPhone app running on an iPhone or an iPad app running on an iPad it works fine but if it is an iPhone only app running on an iPad, tapping to select a UIPickerView doesn't work.

推荐答案

做香草UIPickerView每行使用标题(而不是自定义视图)?如果是这样,则您无需执行任何操作。

Are you just doing a vanilla UIPickerView using titles for each row (and not custom views)? If so, there isn't anything that you should have to do.

您提到VoiceOver正确读取了每一行的标签,因此我们知道UIPickerView正确将isAccessibilityElement设置为YES。

You mentioned that VoiceOver was correctly reading the label on each row, so we know that the UIPickerView correctly has isAccessibilityElement set to YES. It's also correctly reading the accessibilityLabels.

在选择器有机会读取accessibilityHint之前,您是否正在与之交互? (为了他人的利益,accessibilityHint是史蒂夫在他的问题中提到的用一根手指轻拂或向下滑动以调整值。)或者在提示有机会被读取之前,可能有一些通知正在更改VoiceOver焦点?

Is it possible that you're interacting with the picker before it has a chance to read the accessibilityHint? (For the benefit of others, the accessibilityHint is the "swipe or down with one finger to adjust the value" that Steve mentioned in his question.) Or perhaps some notification is changing the VoiceOver focus before the hint has a chance to be read?

这篇关于如何在运行仅iPhone(非通用)应用程序的iPad上的UIPickerView中支持VoiceOver?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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