uiautomator2 icon indicating copy to clipboard operation
uiautomator2 copied to clipboard

Scroll forward 在矩形下沿向上滑,但是开始点被遮挡导致失效

Open fish-ball opened this issue 1 year ago • 1 comments

  • 手机型号:任意
  • uiautomator2的版本号:2.16.23
  • 手机截图 screenshot

fish-ball avatar May 31 '23 06:05 fish-ball

如图,蓝色框即为实际选中的 scrollable 控件。

实际调用代码是这样的:

el = d(resourceId='xxxx:id/rv', scrollable=True)
        print(el.exists, el.count)
        result = el.scroll.forward(steps=10, max_swipes=1000)

开始发现向后划(backward)是有效果的,但是向前滑没效果。

后来排查原因,在开发者选项中打开了“指针位置”,发现只要是 forward,滑动的开始点就必然在蓝框底部,这样会造成手势的起始点落在了被遮盖的页脚栏上,最终导致滚动无效。

然后翻查了一下 API,发现实现的 jsonrpc 中,并没有太多可以定制的余地。

如果框架不改,如何实现这一个操作?

或者说能否从框架层面自动判别解决这种被遮挡的情况?

fish-ball avatar May 31 '23 06:05 fish-ball