如题,img标签的src指定file或者cdvfile协议的图都显示不了,但是http的可以,已经配置了compileProvider
白名单
<!-- 图片显示不了 -->
<img src="cdvfile://localhost/temporary/1443066824077.jpg" alt="" style="max-width: 100%">
<img src="file://......" alt="" style="max-width: 100%">
$compileProvider.imgSrcSanitizationWhitelist(/^\s(https|file|blob|cdvfile):|data:image\//)
图片路径是没问题的,因为可以在手机浏览器直接访问(cdvfile的当然不行啦)
运行环境:
手机:nexus 6
系统:
试一试window.Ionic.WebView.convertFileSrc这个方法.
ionic网站如下记述:
参考以下网站:
https://forum.ionicframework....
https://beta.ionicframework.c...
https://github.com/devomair/f...
经过测试,最后使用了插件webview,问题解决.