码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-12-23 17:13:07      阅读:344      评论: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

(2)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!