我有带图像的 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");
附言。对不起,我的英语不好。