SwipeRefreshLayout是Android自带的实现下拉刷新的控件。
下面我们重点看一下SwipeRefreshLayout的使用吧。
activity_main.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipRefresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColum