Reputation: 351
I have a button with an image and a text to left of it. When I apply them normally there is no space between the image and text but when i set the background to transparent there appears a small gap between the image and text. like this
http://postimg.org/image/hyhzhcyrx/cdcbe297/
and with transparent background it looks like
http://postimg.org/image/tf9joeuxn/077f7816/
i want to set transparent background but i don't want the space between the image and the text? how to do it? my button code is :
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="1"
android:textSize="20sp"
android:textStyle="bold"
android:drawableLeft="@drawable/tick3"
/>
Upvotes: 0
Views: 125
Reputation: 888
You need to set android:drawablePadding in negative to remove space between image and text
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="1"
android:textSize="20sp"
android:textStyle="bold"
android:drawablePadding="-5sp"
android:drawableLeft="@drawable/tick3"
/>
Upvotes: 1