1. 錯誤描述
WebView訪問Url,其他都正常顯示,而圖片不顯示
2. 錯誤原因
可能是設置了不加載圖片,也可能訪問路徑和圖片不是同時使用https或http,例如url使用https,而圖片使用的是http;
3. 解決方案
webview 設置setBlockNetworkImage(bool flag),flag :true不從網絡加載圖片資源,false:加載圖片資源;
和setBlockNetworkLoads(boolean flag)區別:後者是不從網絡加載所有資源;
webSettings.setBlockNetworkImage(false);