我想将图像放在EditText字段中,如图所示。应该怎么做呢?分层列表,在一层上有图像,在另一层的EditText左侧有很多填充?
答案 0 :(得分:8)
在editText中设置图像。
<EditText
......
android:drawableLeft="@drawable/image" />
您可以将其设置为左,右,上,下。
答案 1 :(得分:1)
只需使用
即可setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom)
或
setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom)
方法
干杯