views:

107

answers:

2

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 second one is just under it.

+3  A: 

Use weight parameter, roughly layout will look likw this:

<LinearLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent">
  <LinearLayout android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/>
  <LinearLauout android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent"/>
</LinearLayout>
Konstantin Burov
A: 

Hi Konstantin,

Please could u explain in more detail : why the parameter layout_weight is used??

Regards

Vikas Patidar

Creative-MITian