Android:在EditText中插入位图 [英] Android: Insert Bitmap in EditText

查看:64
本文介绍了Android:在EditText中插入位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在附加的edittext中插入jpeg图像,如下所示.

Stackoverflow已推荐该帖子,但提供的参考项目不再有效.

解决方案

尝试一下,

  EditText文本=(EditText)findViewById(R.id.text);text.setCompoundDrawables(null,null,getResources().getDrawable(R.drawable.check),null); 

就是这样.

I would like to insert jpeg images in edittext attached as shown below.

Stackoverflow has recommended this post but the reference projects provided are no longer valid. how to insert jpeg files in edittext android

Will there be any reference projects?

解决方案

try this,

EditText text = (EditText)findViewById(R.id.text);
text.setCompoundDrawables(null,null,getResources().getDrawable(R.drawable.check), null);

That's it.

这篇关于Android:在EditText中插入位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆