How to leave a fixed button at the end of Linearlayout via code (without using xml)?

Asked

Viewed 788 times

1

I got a linearLayout, and I put it like MATCHPARENT to occupy the entire screen of the tablet, however I needed to leave a fixed button at the end of the screen. Does anyone know how to do this? With xml is easy, but via Java I’m not getting. I thank you already!

1 answer

1

Place the gravity using setGravity(Gravity.BOTTOM).

  • Follow the documentation link for Gravity: http://developer.android.com/reference/android/view/Gravity.html.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.