【发布时间】:2011-03-05 10:21:40
【问题描述】:
我正在尝试使用 android 中的loadDataWithBaseURL() 方法显示 html 文件的内容。
我只有一个字符串,其中包含一个名为 source 的字符串中的 Html 文件数据,然后我将它传递给方法。
例如
String source; //contain html tags with images
View.loadDataWithBaseURl(null,source,"text/html","UTF-8","about:blank");
视图中显示的数据很好。 我的问题是如果我的 html 文件包含任何图像,那么我无法显示它? 我该怎么做?
【问题讨论】:
-
您发布的代码将不起作用,因为 source 将为空,并且 View.load 只有在您有一个以大写字母开头的 View 对象时才能工作。但是您说视图很好,因此我认为这只是示例代码。
标签: html android image webview