Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Layout Division

I want to divide my screen in two parts,I have a LinearLayout and it contains two LinearLayouts again.

How to divide these two LinearLayouts into two equal parts?

like image 628
ramsbh Avatar asked Dec 28 '22 04:12

ramsbh


2 Answers

Just add:

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"

to both of them. The layout_weight parameter being equal distributes the amount of space evenly.

Work on accepting some of the answers to your previous questions, as well.

like image 186
Kevin Coppock Avatar answered Jan 29 '23 06:01

Kevin Coppock


Normally I use android:layout_weight="1" for this. Also you can use a table layout.

like image 31
Ashen Randika Avatar answered Jan 29 '23 04:01

Ashen Randika