Android的布局层次的效率 [英] Efficiency of Android Layout hierarchy
问题描述
这是否(以及以何种方式)的影响表现具有复杂的布局层次?
Does it (and in what way) effect performance to have a complex Layout hierarchy?
在什么样的方式不会影响应用程序有深层嵌套布局(例如RealitiveLayout其中包含许多LinearLayouts均含有....)
In what way does it affect an application to have deeply nested layouts (e.g. RealitiveLayout which contains many LinearLayouts which each contain....)
推荐答案
它有一个作用,越简单越好规则。
It has an effect, the simpler the better is the rule.
每个视图 - 或者更糟,每一个布局管理器 - 您添加到您的
应用程序是有代价的:初始化,布局和绘图成为
慢点。布局通行证,可当你窝特别贵
几个的LinearLayout使用该权重参数,这就要求
孩子两次测量。
Every view — or worse, every layout manager — that you add to your application comes at a cost: initialization, layout and drawing become slower. The layout pass can be especially expensive when you nest several LinearLayout that use the weight parameter, which requires the child to be measured twice.
来源:的http:// Android的开发者。 blogspot.com/2009/02/android-layout-tricks-1.html
这篇关于Android的布局层次的效率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!