为什么UIScrollview在Interface Builder中没有可访问性区域? [英] Why doesn't UIScrollview have an accessibility area in the Interface Builder?

查看:122
本文介绍了为什么UIScrollview在Interface Builder中没有可访问性区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到UIScrollView没有提到可访问性区域,我可以在其中设置辅助功能标签或辅助功能。这似乎也适用于活动指标。

I've noticed that a UIScrollView doesn't have mentioned accessibility area where I can set accessibility label or accessibility. This seems to apply for activity indicators too.

为什么UIVIews,UIButton等有这个区域而不是UIScrollView和UIActivityIndi​​catorView?

Why does UIVIews, UIButtons and more have this area and not UIScrollView and UIActivityIndicatorView?

推荐答案

好问题 - 滚动视图的原因是Apple不认为它是一个可访问的元素。

Good question - the reason for a scroll view is that Apple don't consider it to be an accessible element.

如果您查看 UIAccessibility 文档,您会发现Apple有以下内容可以说明可访问元素:

If you look at the UIAccessibility documentation, you'll find Apple have the following to say on what counts as an 'accessible element':


这个[可访问视图]的唯一例外是一个视图,它只是作为应该可访问的其他项的容器。这样的视图应该实现UIAccessibilityContainer协议并将此属性设置为NO。

The only exception to this [a view being accessible] is a view that merely serves as a container for other items that should be accessible. Such a view should implement the UIAccessibilityContainer protocol and set this property to NO.

A UIScrollView 只是子视图的容器,因此其 isAccessibilityElement 属性设置为no(因此您在界面构建器中看不到辅助功能选项的原因)。

A UIScrollView is simply a container for subviews, so its isAccessibilityElement property is set to no (hence why you don't see the accessibility options in interface builder).

所以基本上,当你使用滚动视图时,其中的应该是可访问的,而不是滚动视图本身。

So basically, when you're using a scroll view the items inside it should be accessible, but not the scroll view itself.

这篇关于为什么UIScrollview在Interface Builder中没有可访问性区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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