我注意到 UIScrollView 没有提到可访问性区域,我可以在其中设置可访问性标签或可访问性。这似乎也适用于事件指标。
为什么 UIVIews、UIButtons 等有这个区域而不是 UIScrollView 和 UIActivityIndicatorView?
最佳答案
好问题 - ScrollView 的原因是 Apple 不认为它是可访问的元素。
如果您查看 UIAccessibility
文档,您会发现 Apple 对“可访问元素”的定义如下:
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.
UIScrollView
只是 subview 的容器,因此它的 isAccessibilityElement
属性设置为 no(因此您在界面构建器中看不到辅助功能选项)。
所以基本上,当您使用 ScrollView 时,其中的项目应该是可访问的,但不是 ScrollView 本身。
关于objective-c - 为什么 UIScrollview 在 Interface Builder 中没有辅助功能区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7685511/