有关 pullToRefreshListView 的一些使用做一下记录
来源:互联网 发布:微店商品导入淘宝店铺 编辑:程序博客网 时间:2024/06/05 09:48
pullToRefreshListView 实现上拉刷新和下拉加载比较方便的一个第三方库。可以自定义其文字的显示内容和动画效果,
private void setPullToRefreshLable() { ILoadingLayout startLoading = pullList.getLoadingLayoutProxy( true, false); startLoading.setPullLabel("下拉刷新");// 刚下拉时显示的提示 startLoading.setRefreshingLabel("正在刷新中...");// 刷新时显示的提示 startLoading.setReleaseLabel("释放即可刷新");// 下拉达到一定距离时显示的提示 ILoadingLayout endLoading = pullList.getLoadingLayoutProxy(false, true); if (lastPage){ endLoading.setPullLabel("没有更多数据");// 刚上拉时显示的提示 endLoading.setRefreshingLabel("没有更多数据");// 加载时的提示 endLoading.setReleaseLabel("没有更多数据");// 上拉达到一定距离时显示的提示// Resources res = getResources();// Drawable drawable = res.getDrawable(0);// endLoading.setLoadingDrawable(drawable); }else { endLoading.setPullLabel("上拉加载更多");// 刚上拉时显示的提示 endLoading.setRefreshingLabel("拼命加载中...");// 加载时的提示 endLoading.setReleaseLabel("释放即可加载更多");// 上拉达到一定距离时显示的提示 } }在其布局文件中可以设置间隔线的颜色,也可以设置播放的动画<pre name="code" class="html"><com.handmark.pulltorefresh.library.PullToRefreshListView xmlns:ptr="http://schemas.android.com/apk/res-auto" android:id="@+id/pull_refresh_list" android:layout_width="match_parent" android:layout_height="match_parent" android:cacheColorHint="#00000000" //背景图 android:divider="#50000000" //间隔线的颜色 android:dividerHeight="2dp" //间隔线的高度 android:smoothScrollbar="true" ptr:ptrMode="both" ptr:ptrDrawable="@drawable/animation_header_refresh">//自定义动画效果</com.handmark.pulltorefresh.library.PullToRefreshListView>
在pulltorefresh中呢 可以使用listview的方法,但是得使用pullRefreshList.getRefreshableView()
比如listview中的添加脚布局在这里就应该写成<pre name="code" class="html" style="font-size: 18px; font-family: 'Courier New';"><span style="font-size: 13.5pt; color: rgb(102, 14, 122); "><strong>pullRefreshList.getRefreshableView().</strong></span><span style="font-size: 13.5pt; color: rgb(102, 14, 122); font-weight: bold; background-color: rgb(181, 251, 164);"></span>addFooterView(view);<span style="font-size: 13.5pt; color: rgb(18, 5, 13);"><strong></strong></span>
而且注意的是如何添加条目点击事件或长按事件的话 获取的position要做减1操作,这样才能准确获取到对应位置的数据。
0 0
- 有关 pullToRefreshListView 的一些使用做一下记录
- 记录一下最近做的项目的一些心得
- 记录一下有关PCA的PWM
- 记录一下使用j2ee版本的eclipse的一些心得
- PullToRefreshListView使用中的一些问题
- PullToRefreshListView使用中的一些问题
- 记录一下python log类的使用 做个记录 慢慢积累
- PullToRefreshListView 的使用
- PullToRefreshListView的简单使用
- Android--PullToRefreshListView的使用
- PullToRefreshListView的使用
- PullToRefreshListView的使用
- PullToRefreshListView库的使用
- PullToRefreshListView的使用
- pullToRefreshListView的使用
- PullToRefreshListView的使用
- PullToRefreshListView的使用
- PullToRefreshListView的使用
- 这是一道简单题目,我居然这个都搞错误了,easy,这个可以直接上公式
- Spring MVC 学习笔记 九 json格式的输入和输出
- Nike Free 3.0 Herren max koston will
- JDBC调用存储函数(PL/SQL)
- JS+CSS简单实现DIV遮罩层显示隐藏
- 有关 pullToRefreshListView 的一些使用做一下记录
- C#定时 器 定时执行任务 线程
- c语言写的发送邮件
- spring的@compont和@service以及@controller,@repository区别
- Spring MVC 学习笔记 十 使用jsr 303进行校验
- Linux基础(三)
- systemctl-chkconfig-service
- static在C和C++中的区别
- 小火山的跳子游戏