UIAutomaion 工具看不到文本字段
我已为视图中的两个文本字段启用“辅助功能”属性,并为它们提供了辅助功能标签,例如“LoginTextField”和“PasswordTextField”。当我在 UIAutomation 脚本中的 mainWindow
上运行 logElementTree
时,我可以看到输出中的文本字段,它们有 rect
和 value
属性,但没有分配标签的 name
属性。当然,mainWindow.textFields()["LoginTextField"] 返回无效对象。我缺少什么?
I've enabled "Accessibility" property for both TextFields that I have on my view and gave them accessibility labels like "LoginTextField" and "PasswordTextField". When I run logElementTree
on mainWindow
in UIAutomation script, I can see the text fields in the output, they have rect
and value
properties, but don't have name
properties with labels assigned. And of course, mainWindow.textFields()["LoginTextField"]
returns invalid object. What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在代码中设置辅助功能属性,而不是笔尖编辑器,看看是否有帮助。
Try to set accessibility properties in code, not nib editor, see if that helps.