1

我期待在 Android 视图客户端(dtmilano)的帮助下滚动列表。列表有 109 个元素,只有 10 个可见。所以我需要向下滚动并再次执行 vc.dump 。请使用示例 python 代码指导执行向下滚动操作。谢谢

4

1 回答 1

1

你应该使用MonkeyDevice.drag()并且你的脚本看起来像这样

list = vc.findViewByIdOrRaise(someid)
(x, y, w, h) = list.getPositionAndSize()
start = (int(x+w/2.0), y+h)
end = (int(x+w/2.0), y)
# scroll 5 times
for i in range(5):
    vc.device.drag(start, end, 1.0, 10)
于 2013-07-09T04:47:41.250 回答