Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout with 2 columns

Tags:

android

layout

Is it possible to create 2 columns using Linearlayout? Something similar to attached image: layout http://dl.dropbox.com/u/16134555/layout.png

like image 213
Ziem Avatar asked Dec 20 '25 04:12

Ziem


2 Answers

Yes it's very easy.

<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
 android:orientation="horizontal">

     <LinearLayout android:layout_width="0dp" android:layout_height="fill_parent" 
     android:layout_weight="1"
     android:orientation="vertical">
     <!-- child views -->
     </LinearLayout>

     <LinearLayout android:layout_width="0dp" android:layout_height="fill_parent" 
     android:layout_weight="1" android:orientation="vertical">
     <!-- child views -->
     </LinearLayout>

</LinearLayout>
like image 167
David Scott Avatar answered Dec 22 '25 19:12

David Scott


Yes you can use a linear horizontal linear layout with two internal linear layout.

<LinearLayout android:orientation="horizontal">
<LinearLayout />
<LinearLayout />
</LinearLayout>
like image 26
Shankar Agarwal Avatar answered Dec 22 '25 18:12

Shankar Agarwal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!