Sujit
Sujit

Reputation: 10622

Fix view at the bottom of the screen in an Activity in android

I want to fix a view at the bottom of the screen.How can i do that?

Upvotes: 1

Views: 1583

Answers (1)

Janusz
Janusz

Reputation: 189444

You can create a Relative Layout that covers the whole screen and use layout_alignParentBottom="true"

<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">

     <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>

Now the text view should always be at the bottom of the screen.

Upvotes: 6

Related Questions