gpt4 book ai didi

ios - UIImagePickerController 编辑时 : buttons()[2] could not be tapped

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:18:58 25 4
gpt4 key购买 nike

在 UIImagePickerController 的裁剪屏幕中,我尝试使用 UIAutomation 点击​​“选择”按钮,但出现此错误:

target.frontMostApp().mainWindow().buttons()[2] could not be tapped

我正在使用这段代码:

var b = target.frontMostApp().mainWindow().buttons()[2];

if (b.checkIsValid()) {
UIALogger.logPass("b, " + b.isValid() + ", " + b.isEnabled());
b.logElement();
b.tap();
} else {
UIALogger.logFail("!b");
}

这是输出:

b, true, 1

UIAButton: name:Choose rect:{{287, 604}, {74, 40}}

target.frontMostApp().mainWindow().buttons()[2].tap()

target.frontMostApp().mainWindow().buttons()[2] could not be tapped

Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().buttons()[2] could not be tapped on line 13 of New%20Script

有人知道如何测试这个吗?感谢您的帮助。

最佳答案

我也遇到了同样的问题,我找到了这个解决方案:

var b = target.frontMostApp().mainWindow().buttons()[2];
var x = b.rect().origin.x + 1;
var y = b.rect().origin.y + 1;
target.tap({x:x, y:y});

它不是很好,但它确实有效......

关于ios - UIImagePickerController 编辑时 : buttons()[2] could not be tapped,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27495649/

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