zoukankan      html  css  js  c++  java
  • materialrefeshlayout下拉刷新,上拉加载更多

    1.添加依赖:compile 'com.cjj.materialrefeshlayout:library:1.3.0'


    2.布局中添加控件,包裹list控件
       <com.cjj.MaterialRefreshLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/refresh"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
       </com.cjj.MaterialRefreshLayout>

    3.初始化布局控件

    4.设置可上拉加更多:refresh.setLoadMore(true);

    5.设置监听回调:refresh.setMaterialRefreshListener(new MaterialRefreshListener() {
      a:下拉刷新
       public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {}
      b:上拉加载更多
       public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {}
  • 相关阅读:
    ZOJ
    Clock(数学题)
    The Lucky Week(规律)
    POJ 3233 Matrix Power Series
    POJ 1061 青蛙的约会(扩展欧几里德算法)
    2266: number
    2263: neighbor
    2269: minval(优先队列)
    HDU
    Problem 2150 Fire Game (广搜+枚举)
  • 原文地址:https://www.cnblogs.com/livelihood/p/6758777.html
Copyright © 2011-2022 走看看