使用如下:
1.先下载android-support-v4.jar最新版本,之前的版本是没有SwipeRefreshLayout下拉刷新控件的。
2.在xml文件中引用android.support.v4.widget.SwipeRefreshLayout控件,在里面可以放置任何一个控件,例如ListView,gridview等。
- <android.support.v4.widget.SwipeRefreshLayout
- android:id="@+id/swipe_refresh"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
- <ListView