I'd like to put an image in an EditText field, as shown. How should one go about this? Layered-list with the image on one layer and a lot of padding on the left side of the EditText on the other layer?
To set the image in editText.
<EditText
......
android:drawableLeft="@drawable/image" />
You can set it Left, Right, Top, Bottom.
Just use the
setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom)
or
setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom)
methods.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With