Android的添加图片到文字(文字版)? [英] Android Add image to text (in text View)?

查看:239
本文介绍了Android的添加图片到文字(文字版)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里的第一篇文章=) 我一直在寻找这个答案,一直没能找到它。 我想要做的是有一些文字,然后添加一个图像,然后剩下的文本。例如:

first post here=) I've been looking for this answer and haven't been able to find it. What I want to do is have some text, then add a image, then rest of text. For example:

                             ____
                            |   |
Hi there, this is the photo |___|, hope you like it..

我一直在寻找,但所有我能找到的文字添加到图像或图像添加到图像查看,我不认为这就是我想要的,因为该应用程序主要是文字,但与它的图像。

I've been looking but all I can find is add text to image or add image to image View, and I don't think that's what I want because the app is mainly text but with images on it.

所以我的问题是:我如何添加图像到文本

So my question is: How do I add an Image to text?

感谢

更新: 我用的意见R.daneel.olivaw给了我和它的工作很好=)

UPDATE: I used the advice R.daneel.olivaw gave me and it worked nice=)

不过,我有一个问题。可以说我有ABC我的设置b的位置spanable。但是,如果我尝试删除的文字,我删除B,下一次我写的东西就会变成我用于spanable图像。如何纠正呢? Any1one有什么建议? 谢谢=)

But I have a problem. lets say i have: "a b c" where I set the position of b as spanable. But if I try to delete the text and I delete b, the next time I write something it will become the image I used in spanable. How do I correct this? Any1one got any advice? thanks=)

推荐答案

我认为你正在寻找的Spannable接口,通过此可以将图像添加到一个文本视图。

I think you are looking for the Spannable interface, By using this you can add images to a text view.

链接可能的帮助。

这篇关于Android的添加图片到文字(文字版)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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