滚动到LHS没有发生..?

时间:2014-05-12 06:20:18

标签: scroll robotium

我想将屏幕滚动到LHS和RHS。因此,我使用以下语句将屏幕滚动到RHS并且工作正常

solo.scrollToSide(Solo.RIGHT);

但是当我使用以下语句将屏幕滚动到LHS时,屏幕不会向左滚动

solo.scrollToSide(Solo.LEFT);

即使我尝试过solo.scrollToSide(21); 但是没用......?

1 个答案:

答案 0 :(得分:1)

为什么不使用这种方法:

void drag(float fromX, float toX, float fromY, float toY, int stepCount) 
Simulate touching the specified location and dragging it to a new location. 

这是关于方法的官方文档:

drag
 public void drag(float fromX,
        float toX,
        float fromY,
        float toY,
        int stepCount) 
Simulate touching the specified location and dragging it to a new location.
 Parameters:fromX - X coordinate of the initial touch, in screen coordinatestoX - X coordinate of the drag destination, in screen coordinatesfromY - Y coordinate of the initial touch, in screen coordinatestoY - Y coordinate of the drag destination, in screen coordinatesstepCount - How many move steps to include in the drag