之前刷新一直用的是PullToRefreshLayout这个库,感觉有不少坑,直到谷歌出了SmartRefreshLayout,就弃用了PullToRefreshLayout。 SmartRefreshLayout是一个“聪明”或者“智能”的下拉刷新布局,由于它的“智能”,它不只是支持所有的View,还支持多层嵌套的视图结构。它继承自ViewGroup 而不是FrameLayout或LinearLayout,提高了性能。还集成了各种炫酷的 Header 和 Footer。 SmartRefreshLayout的目标是打造一个强大,稳定,成熟的下拉刷新框架,并集成各种的炫酷、多样、实用、美观的Header和Footer。
这是一个大神写的,如果需要,大家可以去下载,在此先感谢作者
GitHub地址:https://github.com/scwang90/SmartRefreshLayout
效果展示:
下面我说一下SmartRefreshLayout的基本使用步骤
1.在 buld.gradle 中添加依赖
```
compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-6'
compile 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-6'//没有使用特殊Header,可以不加这行
compile 'com.android.support:recyclerv