Android webview 加载https:// 网站时不展示 图片资源

可能原因是:该图片资源不是https的;

解决办法:


if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}

原因:

Android webview 从Lollipop开始webview默认不允许混合模式,https当中不能加载http资源,需要设置开启。 Mixed content using HTTP and HTTPS on WebViews are disabled by default starting Lollipop. Is possible that is not working on devices with Lollipop? If this is the case, you can change the default WebView setting on Lollipop using: webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);

猜你喜欢

转载自blog.csdn.net/zhongshanyishi/article/details/84033933