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 basi开发者_如何学Pythoncally 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?
What layout is the button in? Using a relative layout, you can set the button to align_parent_bottom.
use a RelativeLayout
with layout_height="fill_parent"
then set the button's layout_alignParentBottom
value to true
in the XML file
Never mind, I created a child LinearLayout only for and I put
android:gravity="bottom"
in the child and it worked :-)
Try using android:layout_gravity="bottom" on the Button :)
精彩评论