1.MaterialRefreshLayout刷新加载:

导入依赖:

compile 'com.cjj.materialrefeshlayout:library:1.3.0'

布局

<com.cjj.MaterialRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"> <ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView> </com.cjj.MaterialRefreshLayout>

//设置进度颜色

int[] colors = new int[1];
colors[0] = getResources().getColor(R.color.back347);
refresh.setProgressColors(colors);
//允许上拉加载
refresh.setLoadMore(true);
//关闭刷新加载按钮
refresh.finishRefreshLoadMore();
refresh.finishRefreshing();
//刷新加载监听
refresh.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
/**
* 刷新
*/
page = 1;
isRequst = true;
requstMessage();
LogUtils.e("刷新");
} @Override
public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {
// TODO Auto-generated method stub
super.onRefreshLoadMore(materialRefreshLayout); if (isRequst) {
page++;
LogUtils.e("加载");
requstMessage();
} }
});
 
 

ListView 刷新加载控件的更多相关文章

  1. 发布我的图片预加载控件YPreLoadImg v1.0

    介绍 大家好!很高兴向大家介绍我的图片预加载控件YPreLoadImg.它可以帮助您预加载图片,并且能显示加载的进度,在预加载完成后调用指定的方法. YPreLoadImg控件由一个名为PreLoad ...

  2. WinForm的延时加载控件概述

    这篇文章主要介绍了WinForm的延时加载控件,很实用的技巧,在C#程序设计中有着比较广泛的应用,需要的朋友可以参考下   本文主要针对WinForm的延迟加载在常用控件的实现做简单的描述.在进行C# ...

  3. 解决tableView中cell动态加载控件的重用问题

    解决tableView中cell动态加载控件的重用问题 tableView的cell,有时候需要在运行时取得对应的数据后才能够动态的创建该cell中的控件并加载到该cell中,此时,你一定会遇到重用问 ...

  4. uGUI动态加载控件位置错误

    最近在使用uGUI时遇到了一个问题,在此记录一下.在Canvas的Render Mode设置为Screen Space-Overlay模式时,动态加载控件是不会发生问题的.但是在Screen Spac ...

  5. uGUI动态加载控件位置错误(转自:https://www.cnblogs.com/mezero/p/4542939.html)

    最近在使用uGUI时遇到了一个问题,在此记录一下.在Canvas的Render Mode设置为Screen Space-Overlay模式时,动态加载控件是不会发生问题的.但是在Screen Spac ...

  6. [iOS微博项目 - 1.8] - 各种尺寸图片加载 & 控件不显示研究

    A. 图片的加载:  [UIImage imageNamed:@"home"];  加载png图片    一.非retina屏幕  1.3.5 inch(320 x 480)  * ...

  7. air mobile andriod ios 页面加载控件

    通过最近的研究flex 书写android .ios申请书,我们遇到了一个问题加载页面,我们用flex sdk 12,air 15 无级似android ListView寻呼模块.所以,我和我的同事们 ...

  8. 每天进步一点点-WPF-根据数据类型加载控件

    目的,根据数据类型的不同,动态的加载适用于不同数据类型的控件(布局) 原理:为自定义的数据类型添加数据魔板,绑定的时候绑定这些数据类型的实例. 例子: 数据类型: 数据模板: <DataTemp ...

  9. 图片加载控件Fresco

    使用教程:https://www.fresco-cn.org/docs/index.html  https://github.com/facebook/fresco application初始化fre ...

随机推荐

  1. Nginx+uwsgi安装配置

    一.安装基础开发包 yum groupinstall "Development tools" yum install zlib-devel bzip2-devel pcre-dev ...

  2. chrome新版安装flash控件失败解决方法

    今天chrome打开后出现插件过期,之后更新一直安装失败 度娘找到一个方法: 1.下载flash最新版for chrome : https://fpdownload.macromedia.com/pu ...

  3. 使用T4模板生成代码的学习

    之前做项目使用的都是Db First,直接在项目中添加Entity Framework,使用T4模板(T4模板引擎之基础入门)生成DAL BLL层等(T4模板是一个同事给的,也没有仔细研究,代码如下: ...

  4. 【杂记】JavaScript篇

    35.jquery中ifram子窗体调用父窗体方法.父窗体调用子窗体方法 //调用子窗体中的方法. ].contentWindow;//获取子窗体的window对象 childWindow.subFo ...

  5. win10本地搭建apache+php+mysql运行环境

    首先下载所需软件: Vc2015:https://www.microsoft.com/zh-CN/download/details.aspx?id=48145 Vc2012:http://www.mi ...

  6. Leetcode: Serialize and Deserialize BST

    Serialization is the process of converting a data structure or object into a sequence of bits so tha ...

  7. Leetcode: Bomb Enemy

    Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return ...

  8. JQuery 筛选器

    1.选择对象1).基本·#id 根据给定的ID匹配一个元素.例如:$("#id")·element 根据给定的元素名匹配所有元素.例如:$("div")·.cl ...

  9. 《zw版·Halcon-delphi系列原创教程》 Halcon分类函数016,xld,xld轮廓

    <zw版·Halcon-delphi系列原创教程> Halcon分类函数016,xld,xld轮廓 为方便阅读,在不影响说明的前提下,笔者对函数进行了简化: :: 用符号“**”,替换:“ ...

  10. 解决VS2015启动时Package manager console崩溃的问题 - Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope

    安装VS2015,启动以后,Package manager console崩溃,错误信息如下: Windows PowerShell updated your execution policy suc ...