开发者

Android button dynamically placed on button

开发者 https://www.devze.com 2023-01-30 23:33 出处:网络
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\"

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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消