-2

I want to make button with text and image like this

image

Madhur
  • 3,303
  • 20
  • 29
Sam
  • 19
  • 3

2 Answers2

1

you should use drawable_left . assign your icons to your widget like this :

<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableLeft="@drawable/your_drawable"
            android:text="@string/your_text" />
Mohammad Rahchamani
  • 5,002
  • 1
  • 26
  • 36
1

Look at this

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/black"
    android:drawableLeft="@mipmap/ic_launcher"
    android:textColor="#FFFFFF"
    android:paddingLeft="10sp"
    android:drawablePadding="5sp"
    android:padding="10dp"
    android:text="Button">
</Button>

Button

see below link

https://i.stack.imgur.com/SZyLl.png

Community
  • 1
  • 1