I am looking to get 4 buttons on the screen. Two on top and tow on bottom. This code gives me the top buttons the way I want it. However when I change layout_alignParentTop=”true” to layout_alignParentBottom=”true” the buttons stay on top. They dont move to the bottom as expected. Any ideas?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentTop="true">
<Button
android:id="@+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" android:text="test">
</Button>
<Button
android:id="@+id/Button03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="test">
</Button>
</LinearLayout>
So you should create parent element as
<RelativeLayout>and in its create two<LinearLayouts>where each contains twoButton. and for align first layout to top you can useandroid:layout_alignParentTop="true"and for align second to bottom useandroid:layout_alignParentBottom="true"