UIAutomaion 工具看不到文本字段

发布于 2025-01-07 05:53:59 字数 329 浏览 5 评论 0原文

我已为视图中的两个文本字段启用“辅助功能”属性,并为它们提供了辅助功能标签,例如“LoginTextField”和“PasswordTextField”。当我在 UIAutomation 脚本中的 mainWindow 上运行 logElementTree 时,我可以看到输出中的文本字段,它们有 rectvalue 属性,但没有分配标签的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很酷不放纵 2025-01-14 05:53:59

尝试在代码中设置辅助功能属性,而不是笔尖编辑器,看看是否有帮助。

Try to set accessibility properties in code, not nib editor, see if that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文