标签:overflow cycle git pac layout important middle 分享 post
用法和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
假设墙不方便:点击下载
标签:overflow cycle git pac layout important middle 分享 post
原文地址:http://www.cnblogs.com/wzjhoutai/p/6941459.html