Android: Meaning of layout_weight

Asked 2 years ago, Updated 2 years ago, 87 views

How do I write the android:layout_weight property?

android-layout android android-widget

2022-09-22 13:54

1 Answers

Android:layout_weight is essentially a proportion property. The proper use of layout_weight allows devices of any resolution to provide the appropriate UI.

For example, if all six LinearLayouts are match_parent, the first LinearLayout will not have the properties of layout_weight The screen will be filled up so you won't be able to see the other layouts. But if you give 1 to each layout_weight, It is evenly output at a ratio of 1:1:1:1:1.

Reference


2022-09-22 13:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.