【发布时间】:2014-08-25 11:32:20
【问题描述】:
我开发了一个具有一个列表视图的应用程序,并且我在下拉时使用 Pull 刷新以刷新列表数据,因此我在代码中完美实现了但是当我向上滚动列表向下滚动但当我在向下滚动它没有滚动完成,因为它考虑拉刷新和刷新数据,但我想在显示列表索引 0 时进行它,然后它可以拉动刷新
所以请帮我解决这个问题
我的代码是
listNotification = (ListView) rootView.findViewById(R.id.listNotification);
listNotification.setCacheColorHint(0);
swipeLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
if (Global.notifications == null) {
swipeLayout.setRefreshing(true);
new GetNotificationList().execute();
}
LoadNotificationToListView();
刷新
@Override
public void onRefresh() {
new GetNotificationList().execute();
}
【问题讨论】: