- 浏览: 181046 次
- 性别:
- 来自: 浙江
文章分类
最新评论
参考链接: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"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.chanven.lib.cptr.PtrClassicFrameLayout
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">
<ListView
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"/>
</com.chanven.lib.cptr.PtrClassicFrameLayout>
</LinearLayout>
或者
<in.srain.cube.views.ptr.PtrFrameLayout
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" >
<LinearLayout
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">
<in.srain.cube.image.CubeImageView
android:id="@+id/store_house_ptr_image"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</in.srain.cube.views.ptr.PtrFrameLayout>
代码初始化:
ptrClassicFrameLayout.setLoadMoreEnable(true);
ptrClassicFrameLayout.setOnLoadMoreListener(this);
ptrClassicFrameLayout.setPtrHandler(this);
刷新控件: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"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.chanven.lib.cptr.PtrClassicFrameLayout
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">
<ListView
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"/>
</com.chanven.lib.cptr.PtrClassicFrameLayout>
</LinearLayout>
或者
<in.srain.cube.views.ptr.PtrFrameLayout
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" >
<LinearLayout
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">
<in.srain.cube.image.CubeImageView
android:id="@+id/store_house_ptr_image"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</in.srain.cube.views.ptr.PtrFrameLayout>
代码初始化:
ptrClassicFrameLayout.setLoadMoreEnable(true);
ptrClassicFrameLayout.setOnLoadMoreListener(this);
ptrClassicFrameLayout.setPtrHandler(this);
发表评论
-
关于Android的webSocket的简单使用
2017-05-12 14:34 920使用第三方jar: autobahn-0.5.0.jar 连 ... -
Comparator自定义排序的使用
2017-05-11 14:18 710java对于集合的自定义排序方法有: Arrays.sort ... -
查看Android虚拟机文件相关命令
2017-05-02 14:12 516我们在虚拟机下添加文件后,想查看下文件是否正确创建,可在win ... -
android6.0创建文件问题
2017-05-02 12:58 539Android在6.0有了动态权限管理,在文件创建时就需要动态 ... -
xutils的http模块的简单使用
2017-04-28 16:05 478先导入xutils相关依赖: compile 'org.xut ... -
Litepal的简单使用
2017-04-27 17:21 593相关包下载地址:https://github.com/Lite ... -
图片加载框架
2017-04-19 16:29 361图片加载框架: picasso ImageLoader -
Android的Service总结
2017-04-17 15:46 413参考链接:http://www.cnblogs.com/lwb ... -
解决ViewPager的addOnPageChangeListener不加载第一个的问题
2017-03-18 17:53 2580今天在使用ViewPager的时候发现个问题。 需求如下: ... -
clone方法的使用
2017-01-04 10:14 513由于Java有引用这一说,当两个变量指向同一块内存时,改变 ... -
Fragment无法切换问题
2016-12-16 14:57 2069Android有一个回收机制,当内存不足时,会自动回收相关内存 ... -
关于Material Design的CollapsingToolbarLayout初次使用
2016-12-16 13:38 570最近了解了下CollapsingToolbarLayout的使 ... -
MVP模式的学习
2016-12-10 15:15 612以前我写代码都是使用MVC模式,这种模式使Activity变得 ... -
Material Design:Android Design Support Library 介绍
2016-12-10 14:14 420参考链接 : https://blog.leancloud.c ... -
SpannableString简介
2016-12-10 14:03 382参考链接: http://www.cnblogs.com/ji ... -
getResources().getDrawable方法的废弃
2016-12-10 13:20 1157参考链接:http://www.jianshu.com/p/e ... -
关于AndroidStudio的Unsupported major.minor version 52.0异常
2016-12-10 13:15 2332参考链接:http://blog.csdn.net/fakin ... -
Android记录
2015-06-01 10:54 602http://tools.android-studio.org ... -
android自定义控件相关使用
2015-04-24 16:53 569用代码简单介绍下自定义控件的使用: 先看主activity: ... -
android使用html标签
2015-03-13 20:42 638有些时候我们需要在一个textview上,对部分字体进行特殊效 ...
相关推荐
打造Android万能下拉刷新上拉加载控件,文档里面是下载地址
Android Studio 上拉加载下拉刷新的DEMO,简单易懂,以后可以在此基础上做扩展
适用于所有的滑动控件,Android下拉刷新上拉加载控件,对所有View通用!实现了ListView、GridView、ExpandableListView、ScrollView、WebView、ImageView、TextView的下拉刷新和上拉加载,自己用过了,非常好
下拉刷新上拉加载控件 Material Design使用 FlexboxLayout
android自定义listview控件 可实现下拉刷新、下拉加载更多的功能,代码比较简单,内有详细注释和实现方法,方便初学者学习
Android自定义控件下拉刷新上拉加载,所有View通用.(直接拿来用).实现了ListView、GridView、ExpandableListView、ScrollView、WebView、ImageView、TextView的下拉刷新和上拉加载
前面写过一篇关于下拉刷新控件的文章下拉刷新控件终结者:PullToRefreshLayout,后来看到好多人还有上拉加载更多的需求,于是就在前面下拉刷新控件的基础上进行了改进,加了上拉加载的功能。不仅如此,我已经把它...
Android适配任意View下拉刷新上拉加载,或上下弹性拽动的ViewGroup控件 http://blog.csdn.net/huanghuangjin/article/details/78244333
android常用下拉刷新+上拉加载控件 有对内容为空和请求失败时的处理, 可以自定义Header和Footer, 可以自定义progress样式等
见过的android中仿iphone最好的控件,实现下拉刷新 上提加载等功能
添加头部、尾部、下拉刷新、上拉加载(感觉又回到ListView时代) 设置自定义的加载更多布局 添加分组(随心定义分组头部) 自定义不同的item类型(简单配置、无需重写额外方法) 设置空布局(比Listview的...
android控件应用 自定义的ListView控件,下拉刷新上拉加载更多,完整的资源应用
Android自定义控件实战——下拉刷新控件终结者:PullToRefreshLayout http://blog.csdn.net/zhongkejingwang/article/details/38340701 3.PullToRefreshDemo.zip(与第一个几乎相同,但使用方便简单,唯一...
Android实现异步从网络加载图片列表和上拉加载更多、下拉刷新列表(使用xListView框架来实现)。。。。。。
源码PullToRefreshAndLoad,Android下拉刷新上拉加载控件,对所有View通用! 这是一个演示如何使用通用的下拉刷新上拉加载控件demo,demo中已经实现了常见的需要上下拉功能的控件,其他控件如果需要加入这两个功能可...
android的ListView上拉刷新下拉加载和列表头横向滚动(带表头与固定列)。 该demo是我结合网上的两个示例一个是上下拉刷新加载的ListView,一个是横向滚动带固定列和列表头.主要是自定义了两个控件(重写)ListView和...
android支持RecyclerView的上拉加载,下拉刷新控件
自从Android 5.0发布以来,越来越多的开发者开始接触RecyeclerView,但是RecyclerView如何实现下拉刷新,上拉加在更多。于是我就偷懒 写了一个,以供大家参考和学习,以待大家改进。 ...
android任意控件上拉加载下拉刷新demo.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。