Value In Brief – by Abanoub Hanna
All You Need To Know Explained In Brief

How to put a Button at the bottom of the screen - Android Development

Android

the whole gravity / layout_gravity is a bit confusing, so here is a snippet:

<LinearLayout android:layout_width="fill_parent"

            android:layout_height="fill_parent"

            android:orientation="horizontal"

            android:gravity="center_horizontal|bottom">

            <Button

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:text="  Back  "

                android:id="@+id/btn_back"/>
</LinearLayout>

The line of code that makes the button at the bottom is android:gravity="center_horizontal|bottom".

« Sliding Notifications Running Multi Module Builds Command Line »