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
  • 36,442
  • 21
  • 78
  • 108
androidnewbie
  • 354
  • 4
  • 19

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
  • 13,135
  • 24
  • 77
  • 112