0

I've searched for weeks but there's no answer for this yet. Most suggestions are to use drawablepadding:left, but this only increases the space away from the egde of the button.

I've also tried drawablemargin:left and right, but they don't bring the button closer to the edge.

Here's the button I have; button with drawable left

Here's what I hope to achieve: button with drawable close to edge

here's the xml snippet:

 <Button
        android:id="@+id/btn_back"
        android:drawableLeft="@drawable/back_button_white"
        android:layout_width="180dp"
        android:layout_height="90dp"
        android:layout_alignParentBottom="true"
        android:background="@drawable/negative_button"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:text="Exit"
        tools:ignore="RtlHardcoded"
        android:textSize="35sp"
        />
Power
  • 41
  • 5

2 Answers2

0

you can use a compound drawable

How to programmatically set drawableLeft on Android button?

Community
  • 1
  • 1
0

try this, i hope is working

<Button
        android:id="@+id/btn_back"
        android:layout_width="180dp"
        android:layout_height="90dp"
        android:includeFontPadding="false"
        android:padding="0dp"
        android:drawableLeft="@drawable/back_button_white"
        android:layout_alignParentBottom="true"
        android:background="@drawable/negative_button"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:text="Exit"
        tools:ignore="RtlHardcoded"
        android:textSize="35sp"
        />

see this http://prntscr.com/cmvhzg, and please use back_button_white as trim image.

Mehul Kabaria
  • 6,404
  • 4
  • 25
  • 50