LinearLayout weight

设置weight需要把width设置为0dp,这样可以提高性能

官方文档解释:

To improve the layout efficiency when you specify the weight, you should change the width of the EditText to be zero (0dp). Setting the width to zero improves layout performance because using "wrap_content" as the width requires the system to calculate a width that is ultimately irrelevant because the weight value requires another width calculation to fill the remaining space.

posted on 2016-05-17 15:13  a0000  阅读(108)  评论(0编辑  收藏  举报

导航