mSwipe.setProgressBackgroundColorSchemeResource(android.R.color.white);
// 设置下拉进度的主题颜色
mSwipe.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimary, R.color.colorPrimaryDark);
mSwipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mList.clear();
}
// 设置下拉进度的主题颜色
mSwipe.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimary, R.color.colorPrimaryDark);
mSwipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mList.clear();
mPageIndex = 1;
initData();
}
});
private void initView() {
mSwipe = (SwipeRefreshLayout) findViewById(R.id.SwipeRefresh);
}
//在适配器数据下面
Swip.setRefreshing(false);
//布局
<android.support.v4.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/Swip" > <ListView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/lv" ></ListView> </android.support.v4.widget.SwipeRefreshLayout>