Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Move Button Text to bottom

Currently I'm creating a button with Image and Text. My problem is I want to move the text to teh buttom of the button.

<Button
  android:layout_weight=".30" 
  android:layout_margin="2dp" 
  android:background="@drawable/btnforgot" 
  android:layout_height="60dp" 
  android:layout_width="100dp" 
  android:text="Forgot "/>

Hope someone can help me out in this regard. Searched many places but couldn't come up with a solution.

Thanks in advance.

like image 791
Jay Mayu Avatar asked Jul 27 '11 08:07

Jay Mayu


2 Answers

Simply add android:gravity="bottom|center" to your Button declaration. If you want to lift it from the bottom slightly, then add android:paddingBottom="4dp" as well.

like image 72
Mark Allison Avatar answered Oct 05 '22 05:10

Mark Allison


I am not sure but android:gravity="bottom" can be helpful to you. Try this inside the <Button>.

Update:

If you want to know about android:gravity and android:layout_gravity then just check this SO question: Gravity and layout_gravity on Android

like image 24
Paresh Mayani Avatar answered Oct 05 '22 06:10

Paresh Mayani