谷歌官方刷新组件SwipeRefreshLayout
2024-10-19 07:39:30
今天开始使用谷歌的SwipeRefreshLayout,会记下一些坑
1.手动调用setRefreshing(true)不会出现刷新动画
原因是:SwipeRefreshLayout indicator does not appear when the setRefreshing(true)
is called before the SwipeRefreshLayout.onMeasure()
解决方法是:http://stackoverflow.com/questions/26858692/swiperefreshlayout-setrefreshing-not-showing-indicator-initially
mSwipeRefreshLayout.setProgressViewOffset(false, 0,
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
mSwipeRefreshLayout.setRefreshing(true);
或者
mSwipeRefreshLayout.ponst(new Runnable(){
public void run(){
mSwipeRefreshLayout.setRefreshing(true);
}
});
个人推荐第二种方法,第一种方法有时候会出现bug
最新文章
- Webwork 学习之路【06】Action 调用
- [ROS]1 小乌龟
- 使用Map List 封装json数据
- 苦B的程序猿道路数据验证
- We Chall-Training: Crypto - Caesar I-Writeup
- 向MIP开源项目提交Issues
- scala读取配置文件
- 2019.3.16数据结构考试(Problem 1. rotinv)(循环逆序对)
- Day02_Python基础学习今日总结
- Pandas 基础(4) - 读/写 Excel 和 CSV 文件
- C#實現XML的增刪查改
- Centos7.03搭建JDK、Tomcat、MySql环境
- Oracle(转换函数)
- triplet改进,变种
- NTRIP协议学习(一)
- 转:一个多目录结构C程序的Makefile
- Tomcat绿色版启动";startup.bat";一闪问题的解决方法!
- sql数据库出现可疑
- forward declaration of class 错误
- simple HTTP server with upload
热门文章
- JAVA面试题:Spring中bean的生命周期
- 关于DJANGO和JAVASCRIPT的时间
- 扩展DJANGO的LISTVIEW
- http://www.linuxidc.com/Linux/2007-09/7399.htm
- HASH暴力破解工具-Hashcat
- 【HDOJ】5296 Annoying problem
- 谈谈数据库中MyISAM与InnoDB区别
- php类 静态变量赋值 static $name=";abc";
- CodeForces Round #285 Div.2
- java高并发,如何解决,什么方式解决