我怎么可以添加的EditText图像 [英] How can I add an image on EditText
本文介绍了我怎么可以添加的EditText图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要动态地的EditText
添加图片。可能吗?
I want to dynamically add image in EditText
. Is it possible?
如果有人知道请给样品code为。
if anyone knows please give sample code for that.
推荐答案
如果是这样的:
是你在说什么,那么你只需要可以设置绘制对象{右|左|顶部|底部}
属性的XML,或者调用相应的java命令。
is what you're talking about, then you just need to either set the Drawable{Right | Left | Top | Bottom}
property in the xml, or call the corresponding java command.
EditText text = (EditText)findViewById(R.id.text);
text.setCompoundDrawables(null, null, getResources().getDrawable(R.drawable.check_box), null);
这篇关于我怎么可以添加的EditText图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文