iOS 辅助功能:使视图和子视图可访问 [英] iOS Accessibility: make view and subview accessible

查看:36
本文介绍了iOS 辅助功能:使视图和子视图可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让 VoiceOver 访问文本字段上的文本字段和子视图.如果我使用 UIAccessibilityContainer 方法,我只能使子视图可访问.有没有办法做到这一点?

I want to make a textfield and a subview on the text field accessible by VoiceOver. If I use UIAccessibilityContainer methods, I can only make the subviews accessible. Is there some way to do this?

推荐答案

.您必须在可访问性层次结构中上一级.在视图的超视图上实现容器协议,并将其所有后代作为子视图(因此,彼此的兄弟视图)返回.

No. You must go up one level in the accessibility hierarchy. Implement the container protocol on your view's superview and return all of its descendants as children (and, thus, siblings of each other).

这篇关于iOS 辅助功能:使视图和子视图可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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