如何添加编辑文本的Andr​​oid里面的图像 [英] How to add a image inside a edit text android

查看:239
本文介绍了如何添加编辑文本的Andr​​oid里面的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想补充的EditText视图中的形象。比如我有形象尺寸为250 * 250我想显示的文字左图像的高度250后所表现出正常左侧位置的文字。

 一些文本一些文本一些文本
  某些图像某些文本一些文本一些文本
               一些文字一些文字一些文字
一些文字一些文字一些文字一些文字一些
文字一些文字一些文字一些文本中的某些文本
一些文字一些文本一些文本的一些文本的一些


解决方案

您可以使用XML属性的android:drawableLeft 或(如前所述) setCompoundDrawableWithinBounds 。但是,你的的EditText 会是这个样子:

I want to add image inside edittext view . For example i have image that size is 250*250 i want to show text left to image for height of 250 after that have to show text in normal left position.

               Some text some text some text
  Some image   Some text some text some text
               Some text some text some text
Some text some text some text Some text some 
text some text some text some text Some text 
some text Some text some text Some text some

解决方案

You can use the xml property android:drawableLeft or (as mentioned) setCompoundDrawableWithinBounds. But your EditText will look something like this:

这篇关于如何添加编辑文本的Andr​​oid里面的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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