SickNick
SickNick

Reputation: 583

Android button dynamically placed on button

I wanted to know if there is a way to place a button on the bottom of the screen, no matter what size screen the device has. I basically want the button to have a gravity="bottom", not just its text. I have been trying to do this, and I cannot find a way to do it. any suggestions?

Upvotes: 0

Views: 260

Answers (4)

SickNick
SickNick

Reputation: 583

Never mind, I created a child LinearLayout only for and I put

android:gravity="bottom"

in the child and it worked :-)

Upvotes: 1

james
james

Reputation: 26271

use a RelativeLayout with layout_height="fill_parent" then set the button's layout_alignParentBottom value to true in the XML file

Upvotes: 1

Cheryl Simon
Cheryl Simon

Reputation: 46844

What layout is the button in? Using a relative layout, you can set the button to align_parent_bottom.

Upvotes: 1

Jason L.
Jason L.

Reputation: 2484

Try using android:layout_gravity="bottom" on the Button :)

Upvotes: 0

Related Questions