如何设置baselineAligned在LinearLayout中虚假提高性能?虚假、如何设置、性能、LinearLayout

由网友(故事与旧友)分享简介:我只是建立在XML中的一些UI和林特给了我一个警告,说要设置的android:baselineAligned为false以提高性能的ListView I was just building some UI in xml, and Lint gave me a warning and said to set andro...

我只是建立在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 =假获得更好的性能,并且还   发现在那里你有嵌套的重量,将可能会导致性能的情况下   的问题。

Layout performance: Finds LinearLayouts with weights where you should set android:baselineAligned="false" for better performance, and also finds cases where you have nested weights which can cause performance problems.

有人可以解释为什么这可以提高性能,参与权重特别是当?

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)

阅读全文

相关推荐

最新文章