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?

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?

在editText中设置图像。
<EditText
......
android:drawableLeft="@drawable/image" />
您可以设置它左,右,上,下。
只需使用
setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom)
或者
setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom)
方法。
干杯