Html.fromHtml问题 [英] Html.fromHtml problem
本文介绍了Html.fromHtml问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Html.fromhtml在EDITTEXT插入的图片,但而不是显示图像,它会显示[OBJ]内方文OBJ
可能是什么问题?
这是imageGetter
ImageGetter imageGetter =新ImageGetter(){
公众可绘制getDrawable(字符串源){
可绘制D = getResources()getDrawable(R.drawable.e11)。
d.setBounds(0,0,d.getIntrinsicWidth(),d.getIntrinsicHeight());
返回D组;
}
};
这是code线:
的CharSequence CS =
Html.fromHtml(&下; IMG SRC =+ getResources()getDrawable(R.drawable.e11)+'/>中
,imageGetter,NULL);
解决方案
您 imageGetter
实例没有做正确的事情。它在哪里尝试从图像又是什么样子呢?
I'm using Html.fromhtml to insert image in an editText ... but the instead of displaying the image, it displays [obj] " the text obj inside a square" what could be the problem ?? This is the imageGetter
ImageGetter imageGetter = new ImageGetter() {
public Drawable getDrawable(String source) {
Drawable d = getResources().getDrawable(R.drawable.e11);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
return d;
}
};
This is the code line:
CharSequence cs =
Html.fromHtml("<img src='" +getResources().getDrawable(R.drawable.e11)+ "'/>"
,imageGetter, null);
解决方案
Your imageGetter
instance is not doing the correct thing. Where is it trying to retrieve the images from and what does it look like?
这篇关于Html.fromHtml问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文