gpt4 book ai didi

javascript - iOS UI自动化脚本: What's the correct predicate to reference the keyboard?

转载 作者:行者123 更新时间:2023-11-28 16:36:32 25 4
gpt4 key购买 nike

使用

UIATarget.localTarget().frontMostApp().logElementTree;

当我知道存在键盘时(点击文本字段后),显示层次结构中存在 UIAKeyboard 元素。然而,它没有名字。我想得到对此的引用,以便我可以将其从脚本中删除。我最好的猜测是使用类似的东西:

UIATarget.localTarget().frontMostApp().elements().firstWithPredicate("类似 UIAElement 的类");

但我无法找出正确的谓词字符串格式。如果大家知道更好的方法,请指导我。

最佳答案

参见 UIAApplication.keyboard():

返回代表应用程序键盘的 UIAKeyboard 对象(如果存在)。

我用来选择“Go”的示例:


var app = UIATarget.localTarget().frontMostApp();
app.keyboard().elements()["go"].tap();

关于javascript - iOS UI自动化脚本: What's the correct predicate to reference the keyboard?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3699056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com