一. 导入依赖
compile 'com.github.userswlwork:pull-to-refresh:1.0.0' 二. 注意布局是在用 pullToRefreshScrollView ListView是在用动态添加<com.handmark.pulltorefresh.library.PullToRefreshScrollView android:id="@+id/pull_ref" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.yuekaomoni.MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <com.youth.banner.Banner android:layout_width="match_parent" android:layout_height="200dp" android:layout_weight="1" android:id="@+id/ban" ></com.youth.banner.Banner> <com.example.yuekaomoni.Mylistview android:id="@+id/My_list" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="2.5"></com.example.yuekaomoni.Mylistview> </LinearLayout> </com.handmark.pulltorefresh.library.PullToRefreshScrollView>