如何在Android的TextView中显示的图像?图像、如何在、Android、TextView

2023-09-11 20:18:06 作者:人情薄如纸

我想一些插图中的图像TextView中。怎么做?任何想法

I want to inset some images in the TextView. How to do it? Any idea

推荐答案

您可以创建一个spannableString以及您希望在TextView中把你的形象。或者你也可以使用

You can create a spannableString and place your image where you want in the TextView. Or you can use

ImageSpan is = new ImageSpan(context, resId);
text.setSpan(is, index, index + strLength, 0);