gpt4 book ai didi

android - Android Layout层级的效率

转载 作者:搜寻专家 更新时间:2023-11-01 09:10:20 33 4
gpt4 key购买 nike

具有复杂的布局层次结构是否(以及以何种方式)影响性能?

它以何种方式影响具有深层嵌套布局的应用程序(例如,RealitiveLayout 包含许多 LinearLayouts,每个 LinearLayouts 包含....)

最佳答案

它有一个作用,规则越简单越好。

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-developers.blogspot.com/2009/02/android-layout-tricks-1.html

关于android - Android Layout层级的效率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8672647/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com