问题描述
我只是建立在XML中的一些UI和林特给了我一个警告,说要设置的android:baselineAligned为false以提高性能的ListView
I was just building some UI in xml, and Lint gave me a warning and said to set android:baselineAligned to false to improve performance in ListView.
该文档为加入此警告说,皮棉的变化
The docs for the Lint changes that added this warning say
布局表现:查找LinearLayouts配重块,你应该 集机器人:baselineAligned =假获得更好的性能,并且还 发现在那里你有嵌套的重量,将可能会导致性能的情况下 的问题。
有人可以解释为什么这可以提高性能,参与权重特别是当?
Can somebody explain why this improves performance, specifically when weight is involved?
推荐答案
通过设置安卓baselineAligned =假
,你是preventing额外的工作您的应用程序的布局有做以调整其子女的基线;它可以显着提高性能。 (在UI =>更好的性能,更少的不必要的操作)
By setting android:baselineAligned="false"
, you're preventing the extra work your app's layout has to do in order to Align its children's baselines; which can obviously increase the performance. (Less unnecessary operations on UI => Better performance)
这篇关于如何设置baselineAligned在LinearLayout中虚假提高性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!