I've got a button and a drawable on the left of the text, but I want the drawable to be closer to the text. So I need to move the drawable.
I've defined android:drawableLeft but the content of the button is not centered.
Here is my code:
<Button android:id="@+id/addsubject" android:layout_width="250dp" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_action_add" android:layout_centerHorizontal="true" android:layout_alignParentTop="true" android:layout_marginTop="20dp" android:text="@string/addsubject" android:textColor="@color/white" android:background="@drawable/custombutton1" />
Here is how it looks now:
And here is how I'd like it to be:
Thank you!
try this
<Button android:id="@+id/addsubject" android:layout_width="160dip" android:layout_height="60dip" android:layout_gravity="center" android:drawableLeft="@drawable/ic_action_add" android:drawablePadding="2dip" android:gravity="center" android:paddingLeft="30dip" android:paddingRight="26dip" android:singleLine="true" android:text="@string/addsubject" android:textSize="13dip" />
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