今天开始使用谷歌的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

最新文章

  1. Webwork 学习之路【06】Action 调用
  2. [ROS]1 小乌龟
  3. 使用Map List 封装json数据
  4. 苦B的程序猿道路数据验证
  5. We Chall-Training: Crypto - Caesar I-Writeup
  6. 向MIP开源项目提交Issues
  7. scala读取配置文件
  8. 2019.3.16数据结构考试(Problem 1. rotinv)(循环逆序对)
  9. Day02_Python基础学习今日总结
  10. Pandas 基础(4) - 读/写 Excel 和 CSV 文件
  11. C#實現XML的增刪查改
  12. Centos7.03搭建JDK、Tomcat、MySql环境
  13. Oracle(转换函数)
  14. triplet改进,变种
  15. NTRIP协议学习(一)
  16. 转:一个多目录结构C程序的Makefile
  17. Tomcat绿色版启动"startup.bat"一闪问题的解决方法!
  18. sql数据库出现可疑
  19. forward declaration of class 错误
  20. simple HTTP server with upload

热门文章

  1. JAVA面试题:Spring中bean的生命周期
  2. 关于DJANGO和JAVASCRIPT的时间
  3. 扩展DJANGO的LISTVIEW
  4. http://www.linuxidc.com/Linux/2007-09/7399.htm
  5. HASH暴力破解工具-Hashcat
  6. 【HDOJ】5296 Annoying problem
  7. 谈谈数据库中MyISAM与InnoDB区别
  8. php类 静态变量赋值 static $name="abc"
  9. CodeForces Round #285 Div.2
  10. java高并发,如何解决,什么方式解决