cordova iOS blank iframe iphone iframe 白屏 ios iframe 白屏

(1)解決方案html

http://stackoverflow.com/questions/36572537/cordova-ios-blank-iframe/36587026android

 

在 index.html中配置metaios

<meta http-equiv="Content-Security-Policy" 
content="default-src *; frame-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; 
script-src * 'self' 'unsafe-inline' 'unsafe-eval';">web

 

context-security-policy中詳細請查看:dom

https://content-security-policy.com/iphone

 

(2)在config.xml中配置ionic

<access origin="*" subdomains="true" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />ui

 

以上就能夠在 iphone 經過 iframe導入,可是別忘記,argularjs中的把url設置爲可信源url

$sce.trustAsResourceUrl(url)xml

 (3)cordova+ionic+argular  在android中

讓滾動條仍然存在

可是隱藏,可以使用下面的CSS

::-webkit-scrollbar, *::-webkit-scrollbar { display: none; }

相關文章
相關標籤/搜索