0

I can now have a button that contains a single image icon and text, just like below (the red square is the image):

enter image description here

<Button
    android:id="@+id/btn"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:background="@drawable/shadow"
    android:drawableLeft="@drawable/redsquare"
    android:drawablePadding="6dp"
    android:text="Text goes here"
    android:textColor="@android:color/white"
    android:textSize="14dp"
    android:textAllCaps="false"
    android:gravity="left|center" />

However, I want to have the button as shown below (two small red squares are two different images):

enter image description here

I tried to add another drawable in the button, but the result is not as expected. May I ask how can I achieve the same result as above button, please?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
androidnewbie
  • 374
  • 1
  • 6
  • 23

1 Answers1

1

Better approach would be to use an custom button or custom view with either ripple effect or custom button selector added to the view.

Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126