I am trying to split my layout into two halves.When I try layout_weight,in splits it into two horizontal halves.How do i split the layout into two vertical halves.
<?xml version="1.0" encoding="utf-8"?>
android:id="@+id/linearLayout123" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_weight="1"
android:layout_gravity="top"
android:id="@+id/linearLayout12"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
<LinearLayout android:layout_weight="1"
android:layout_gravity="bottom" android:id="@+id/linearLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
</LinearLayout>
</LinearLayout>
Use 'orientation="vertical"' in the enclosing layout, and apply your weights to the children such as: