参考链接:http://www.jianshu.com/p/699e2662fc27

刷新控件:in.srain.cube.views.ptr.PtrFrameLayout 和com.chanven.lib.cptr.PtrClassicFrameLayout

导包:
compile 'in.srain.cube:ultra-ptr:1.0.11'

compile 'com.chanven.lib:cptr:1.0.0'

使用Xml文件:

<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:id="@+id/test_list_view_frame"
xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f0f0f0"
cube_ptr:ptr_resistance="1.7"
cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
cube_ptr:ptr_duration_to_close="200"
cube_ptr:ptr_duration_to_close_header="1000"
cube_ptr:ptr_keep_header_when_refresh="true"
cube_ptr:ptr_pull_to_fresh="false">

android:id="@+id/test_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:choiceMode="singleChoice"
android:divider="#b0b0b0"
android:dividerHeight="0.1dp"
android:fadingEdge="none"
android:scrollbarStyle="outsideOverlay"/>



或者

android:id="@+id/store_house_ptr_frame"
xmlns:cube_ptr="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
cube_ptr:ptr_resistance="1.7"
cube_ptr:ptr_ratio_of_header_height_to_refresh="1.2"
cube_ptr:ptr_duration_to_close="300"
cube_ptr:ptr_duration_to_close_header="2000"
cube_ptr:ptr_keep_header_when_refresh="true"
cube_ptr:ptr_pull_to_fresh="false" >
android:id="@+id/store_house_ptr_image_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/cube_mints_333333"
android:clickable="true"
android:padding="10dp">
android:id="@+id/store_house_ptr_image"
android:layout_width="match_parent"
android:layout_height="match_parent" />



代码初始化:
ptrClassicFrameLayout.setLoadMoreEnable(true);
ptrClassicFrameLayout.setOnLoadMoreListener(this);
ptrClassicFrameLayout.setPtrHandler(this);

更多相关文章

  1. Android(安卓)开发中,pullToRefreshListView 的刷新,加载
  2. Android(安卓)space控件:间隙留白
  3. Android的简单组件总结
  4. Android提高第十九篇之"多方向"抽屉[转]
  5. Android事件分发机制
  6. Android(安卓)Layout XML属性
  7. Android调用JNI出错 java.lang.UnsatisfiedLinkError: No implem
  8. Android.GridView事件监听
  9. 浅析Android事件分发机制

随机推荐

  1. Android Recovery模式学习体会
  2. android之远程服务的调用
  3. 如何向Android的framework里添加新类 &&&
  4. Android中AsyncTask的使用与源码分析
  5. android 根据图片路径获取图片缩略图
  6. android 主要的布局控件简介
  7. Android(安卓)dispatchTouchEvent
  8. 弄点好玩的之android传感器
  9. zz:Android 二维码 生成和识别(附Demo源码
  10. Android中使用Pull解析器解析xml文件+进