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.



posted @ 2015-12-28 20:13  hrhguanli  阅读(1628)  评论(0编辑  收藏  举报