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), 权值会被计算两次, 改变时, 会按照比例进行改变.

解决方法: 使用RelativeLayoutGridLayout代替LinearLayout.



郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。