【发布时间】:2016-04-25 08:58:16
【问题描述】:
我正在尝试在 iOS 9.3.1 上的 phonegap 应用中显示 iframe。出于某种原因(因此这个问题),iframe 出现在 android 上,但没有出现在 ios 上。
设置: 1. 在mac上,我安装了PhoneGap desktop v0.3.1并创建了一个新的应用程序
-
在 index.html 中我添加了 iframe
<body> <iframe src="http://www.w3schools.com" style="border-style:solid; width:750px; height:500px;"/> <div class="app"> <h1>PhoneGap</h1> <div id="deviceready" class="blink"> <p class="event listening">Connecting to Device</p> <p class="event received">Device is Ready</p> </div> </div> <script type="text/javascript" src="cordova.js"></script> <script type="text/javascript" src="js/index.js"></script> <script type="text/javascript"> app.initialize(); </script> </body> -
然后在安装了 PhoneGap 应用程序 (https://itunes.apple.com/us/app/phonegap-developer/id843536693?mt=8) 的 iPad 上进行了测试:在 android 上它可以工作,而在 ios 上它不显示(我可以看到边框,但看不到内容)
-
然后将 config.xml 更改为更宽松
<access origin="*" /> <allow-intent href="*" /> <allow-navigation href="*" /> <plugin name="cordova-plugin-whitelist" version="1"/> <allow-intent href="*" /> <allow-navigation href="*" /> <platform name="android"> <allow-intent href="*" /> </platform> <platform name="ios"> <allow-intent href="*" /> </platform>
并添加 在 index.html 中
- 再次测试,结果与 3 相同。
【问题讨论】: