Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 机器人中的快速滚动_Android_Scroll_Robotium - Fatal编程技术网

Android 机器人中的快速滚动

Android 机器人中的快速滚动,android,scroll,robotium,Android,Scroll,Robotium,我已经为我的Android项目创建了一个测试项目。在我的应用程序中,有一个包含大量数据的列表视图。我需要使用Robotium上下滚动此列表视图。我使用了scrollUp和scrollDown功能,但它的滚动速度太慢 我使用的是Robotium 3.3。有没有办法制作一个快速卷轴 int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth(); int screenHeight = getActiv

我已经为我的Android项目创建了一个测试项目。在我的应用程序中,有一个包含大量数据的列表视图。我需要使用Robotium上下滚动此列表视图。我使用了scrollUp和scrollDown功能,但它的滚动速度太慢

我使用的是Robotium 3.3。有没有办法制作一个快速卷轴

int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth();
int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight();

         int fromX, toX, fromY, toY = 0,stepCount=1;

         // Scroll Down // Drag Up
         fromX = screenWidth/2;
         toX = screenWidth/2;
         fromY = (screenHeight/2) + (screenHeight/3);
         toY = (screenHeight/2) - (screenHeight/3);

solo.drag(fromX, toX, fromY, toY, stepCount);
这里

[1] 步数=1;//快速滚动

[2] 步数=10;//中卷

[3] 步数=17;//慢卷轴

因此,您可以根据滚动所需的速度来调整stepCount值

我希望这将有助于您更好地滚动列表视图。 谢谢

这里

[1] 步数=1;//快速滚动

[2] 步数=10;//中卷

[3] 步数=17;//慢卷轴

因此,您可以根据滚动所需的速度来调整stepCount值

我希望这将有助于您更好地滚动列表视图。 谢谢