Android nested layouts

后端 未结 2 1199
暖寄归人
暖寄归人 2020-12-18 03:22

I am new to android layouts, Could please tell me how the performance of application when using nested layouts instead of using layout below, layout above, layout right, la

2条回答
  •  醉酒成梦
    2020-12-18 03:55

    Well some layouts can only be made by doing some level of nesting. But you should avoid having too many nested LinearLayouts and even more important NEVER nest LinearLayouts with weights. You can read a little more about optimizing layouts in the official docs.

    Personally I use LinearLayouts for simple stuff and start using RelativeLayout when the layout gets more complex. There is no one answer as it is a matter of preference.

提交回复
热议问题