首页 > 代码库 > Android - 警告Nested weights are bad for performance
Android - 警告Nested weights are bad for performance
Android - 警告Nested weights are bad for performance
本文地址: http://blog.csdn.net/caroline_wendy
原因: Layout weights require a widget to be measured twice. When a LinearLayout with non-zero weights is nested inside another LinearLayout with non-zero weights, then the number of measurements increase exponentially.
嵌套权值(Nested Weights), 权值会被计算两次, 改变时, 会按照比例进行改变.
解决方法: 使用RelativeLayout或GridLayout代替LinearLayout.
Android - 警告Nested weights are bad for performance
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。