标签:android-pullrefreshl pullrefreshlayout android
使用方法和SwipeRefreshLayout差不多。
在xml中:
1
2
3
4
5
6
|
<com.baoyz.widget.PullRefreshLayout android:id= "@+id/swipeRefreshLayout" android:layout_width= "match_parent" android:layout_height= "match_parent" > <!-- ListView、ScrollView、RecyclerView、Other --> </com.baoyz.widget.PullRefreshLayout> |
实例化:
1
2
3
4
5
6
7
8
9
10
|
PullRefreshLayout layout = (PullRefreshLayout) findViewById(...); // listen refresh event layout.setOnRefreshListener( new PullRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // start refresh } }); // refresh complete layout.setRefreshing( false ); |
改变刷新样式:
1
|
layout.setRefreshStyle(PullRefreshLayout.STYLE_CIRCLES); |
有三种样式,分别是:CIRCLES
、 WATER_DROP
和 RING
.
Github下载:https://github.com/baoyongzhang/android-PullRefreshLayout
如果墙不方便:点击下载
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:android-pullrefreshl pullrefreshlayout android
原文地址:http://blog.csdn.net/onceing/article/details/46777189