设置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.
本文介绍在Android开发中通过将EditText的宽度设置为0dp来提高布局效率的方法,解释了这种做法如何改善性能并减少不必要的宽度计算。
963

被折叠的 条评论
为什么被折叠?



