Swiperefreshlayout Google's official drop-down refresh control, I was using on the ListView.
To define a layout file:
1 LinearLayout2 xmlns:android= "Http://schemas.android.com/apk/res/android"3 android:orientation= "Vertical"4 android:layout_width= "Match_parent"5 android:layout_height= "Match_parent" >6 <Android.support.v4.widget.SwipeRefreshLayout7 Android:id= "@+id/srl_drop_down_refresh"8 Android:layout_width= "Match_parent"9 Android:layout_height= "Match_parent">Ten <ListView One Android:id= "@+id/lv_stock_news_dapan" A Android:layout_width= "Match_parent" - Android:layout_height= "Match_parent"/> - </Android.support.v4.widget.SwipeRefreshLayout> the </LinearLayout>
To set control properties:
1 Mrefreshlayout = (swiperefreshlayout) Mrootview.findviewbyid (R.id.srl_drop_down_refresh); 2 Mrefreshlayout.setonrefreshlistener (this); 3 mrefreshlayout.setcolorschemeresources (4 Android. R.color.holo_blue_bright, Android. R.color.holo_green_light,5 Android. R.color.holo_orange_light, Android. R.color.holo_red_light);
Then you can see the effect, no longer have to bother to develop a pull refresh control, of course, to use SUPPORT.V4 this package
Android Development: Using Swiperefreshlayout to implement a pull-down refresh