How to put images in the EditText field?

I would like to put the image in the EditText field as shown. How can I do that? A layered list with an image on one layer and a lot of additions on the left side of the EditText at another level?

enter image description here

+5
source share
2 answers

To set the image to editText.

<EditText
   ......  
    android:drawableLeft="@drawable/image" />

You can set it left, right, top, bottom.

+8
source

Just use

setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom)

or

setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom)

methods.

Greetings

+1
source

All Articles