首页 > 其他 > 详细

robotium listview上拉加载更多/下拉刷新

时间:2014-12-23 17:11:44      阅读:1352      评论:0      收藏:0      [点我收藏+]
        ListView listview = (ListView) solo.getView("id/list");
        int[] location = new int[2];
        listview.getLocationOnScreen(location);
        location[1] = location[1] + listview.getBottom();
        Log.i(TAG, "[Location x]:  " + Integer.toString(location[0]));
        Log.i(TAG, "[Location y]:  " + Integer.toString(location[1]));
//获取上拉加载更多拖动点的坐标
if (solo.waitForView(listview)) { int newlistcount, listcount = listview.getCount(); while (true) { solo.scrollListToLine(listview, listcount); solo.sleep(500); solo.drag(location[0] + 10f, location[0] + 10f, location[1] - 10f, location[0] - 100f, 50); solo.sleep(2000); newlistcount = listview.getCount(); if (newlistcount == listcount) { break; } else { listcount = newlistcount; Log.i(TAG, "[List count]: " + Integer.toString(listcount)); } } }

 

robotium listview上拉加载更多/下拉刷新

原文:http://www.cnblogs.com/huangjianan/p/4180165.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!