Thursday, 13 October 2011

Button at bottom of screen

The whole gravity / layout_gravity thing 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>

No comments:

Post a comment