Описание тега android-layout-weight
In Android by setting a layout_weight for the Views inside the LinearLayout, the parent layout divides the available space between its children according to their weights.
Description
Indicates how much of the extra space in the LinearLayout will be allocated to the view associated with these LayoutParams.
By setting a layout_weight for the Views inside the LinearLayout, the parent layout divides the available space between its children according to their weights.
Implementation
A Vertical LinearLayout with 2 Views. Top View has layout_weight of 3 and bottom one has 1, which means total of 4. Top View will fill 3/4 of the Layout and bottom one will fill 1/4 of the Layout.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<View
android:id="@+id/view1"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="3"/>
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"/>
</LinearLayout>
Link