I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout. I want to do this to keep the same relative layout across different screen sizes. Currently, the buttons on my screen move up/down depending on the resolution of the screen. 320x480 puts the buttons higher on the screen versus 480x800. I'm trying to get my screens to look the same between the two sizes.
From Settings, go to System, Gestures, and then tap System Navigation. Gesture navigation will be selected by default, but you can tap 3-button navigation to make buttons appear at the bottom of your screen.
If you want to add Buttons to the bottom of your android layout XML file you can achieve it using attribute layout_gravity on LinearLayout or TableRow layout. Below your Parent Layout tag add a LinearLayout or TableRow with attribute android:layout_gravity="bottom".
By default, all child views are drawn at the top-left of the layout, so you must define the position of each view using the various layout properties available from RelativeLayout.
I know this is an old thread but it shows up at the top of search results so I figure it can't hurt to confirm that
android:layout_alignParentBottom="true"
worked for me in RelativeLayout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With