首页 > 代码库 > robotium listview上拉加载更多/下拉刷新
robotium listview上拉加载更多/下拉刷新
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上拉加载更多/下拉刷新
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。