I am building an application where I need to make some layout. Normally I use Relative Layout and custom views which makes my work however this time, I think of using Liner Layout so I made this below XML. My aim was to make a child linear layout inside a parent and make than child's gravity to "bottom" which will hold my two bottom, one should be right aligned and one should be left aligned.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:gravity="bottom"
>
<Button
android:gravity="left"
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Previous" />
<Button
android:id="@+id/button3"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"/>
</LinearLayout>
The child is sitting in the bottom however two views that is buttons are not aligned properly. Am I doing anything wrong, or can these things not be achieved through this Layout?