1.加载url前,设置图片阻塞
1. webSettings.setBlockNetworkImage( true );
2.加载完毕后,关闭图片阻塞
1. public void onPageFinished(WebView view, String url) {
2. webSettings.setBlockNetworkImage( false );
3.
4. super.onPageFinished(view, url);
5. }
3.乱码问题
String data = "<html><body><div>" +标签:setBlockNetworkImage,url,乱码,android,null,data,webView,加载 From: https://blog.51cto.com/u_15907753/5926284
"<img src='http://www.baidu.com/img/baidu_sylogo1.gif' width='270' height='129'/></div><div>测试文字</div>" +
"</body></html>";
web.loadDataWithBaseURL(null, data, "text/html", "utf-8", null);