What is the difference between addView and addViewInLayout?
2015-12-17 16:21
651 查看
转自stackoverflow
Its generally a bad idea to call addViewinside onLayoutbecause addViewinternally triggers a requestLayoutwhich eventually will call onLayout. So you end up triggering a layout while you are in the middle of a layout. addViewInLayoutis a "safer" version of the addViewin the case you really have to add a new view in onLayout. It basically doesn't trigger a layout pass (doesn't call requestLayout internally). See this video (by android engineer) for more detail: http://www.youtube.com/watch?v=HbAeTGoKG6k |
相关文章推荐
- 移动H5前端性能优化指南
- bootstrap表单学习笔记3-3
- AngularJS学习笔记
- html使用include出现乱码乱字符号解决方法
- H5兄弟连web前端
- 如何选择使用的HTML标签
- jquery文件上传控件 Uploadify 问题记录
- jQuery formValidator表单验证插件常见问题
- ExtJS5 - 使用vtype自定义表单域的验证规则
- 【学习笔记javascript设计模式与开发实践(迭代器模式)----7】
- 圣诞来了 h5游戏风靡朋友圈了
- caffe+ubuntu 32位+atlas最少配置方法
- 判断JS对象是否拥有某属性的方法举例
- ExtJS5 - 编码规范
- [Servlet&JSP] JSTL的使用
- JVM监控工具:jps、jstat、jinfo、jmap、jhat、jstack使用介绍
- bootstrap表单学习笔记3-2
- jquery遍历json的几种方法
- HTML5新元素section和article的区别详解
- Protocol Buffer技术详解(语言规范)