本文介绍了UIAutomation嵌套的Accessibilty元素从层次结构中消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含按钮和图像的两个子视图的视图,我打开辅助功能并在子视图上设置标签,我可以通过调用
$ b <$ p来查看层次结构$ p>
UIATarget.localTarget()frontMostApp()主窗口()logElementTree()。;
我得到以下例子:
如果我打开辅助功能并为我父母设置标签我无法再在层次结构中的任何位置看到我的按钮和图像。
我得到:
为什么我的观点消失了吗?
解决方案
直接来自iOS文档
I have a view with two subviews a button and an Image, I turn on accessibility and set the label on the subviews and I can see the hierarchy by calling
UIATarget.localTarget().frontMostApp().mainWindow().logElementTree();
I get the following for example:
If I then turn on accessibility and set the label for my parent view I can no longer see my button and image anywhere in the hierarchy.
I just get:
Why have my views disappeared?
解决方案
Straight from the iOS docs Accessibility Guide
这篇关于UIAutomation嵌套的Accessibilty元素从层次结构中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!