Log:Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure image
'http://xxx.png'. This request has been blocked; the content must be served over HTTPS."
迁入的WebView图片显示不出来
解决:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
本文介绍了解决WebView在加载HTTPS页面时遇到的MixedContent错误的方法,通过设置WebSettings的MixedContentMode为MIXED_CONTENT_ALWAYS_ALLOW,允许混合内容加载,解决了图片无法显示的问题。
9726

被折叠的 条评论
为什么被折叠?



