Wanna to split a screen for my app with two LinearLayouts. What parameters should I use to make exact splitting in two equal parts - first LinearLayout on the top and the se
Use Layout Weights. Keep in mind that it is important to set layout_width as 0dp on children to make it work as intended.
on parent layout:
weightSum of parent Layout as 1 (android:weightSum="1")on the child layout:
layout_width as 0dp (android:layout_width="0dp") layout_weight as 0.5 [half of weight sum fr equal two] (android:layout_weight="0.5")weightSum 3layout_weight: 1weightSum 1layout_weight: 0.25To split layout to n equal parts:
- parent:
weightSumn- child:
layout_weight: 1