【发布时间】:2014-12-02 07:10:59
【问题描述】:
我有带图像的 WebView,一切正常,但如果我禁用网络连接。用图像打开我的 webview,我会得到一个丑陋的非图像。我如何用自定义图像替换默认的“无图像”?有人有想法吗?
我使用 loadData 和缓存文件。
> String customHtml = "<html><body><h1>Hello,</h1>" +
> "<img src=\"http://somesite.com/image.jpg\">" +
> "</body></html>";
> webView = (WebView) findViewById(R.id.MyWebView);
> webView.loadData(customHtml, "text/html; charset=utf-8", "UTF-8");
ps。对不起我的英语不好。
【问题讨论】:
-
njzk2,谢谢,是的。这个解决方案我已经搜索并找到了。
标签: android image webview loaddata