【发布时间】:2019-06-20 03:48:09
【问题描述】:
我正在使用cordova 8.1.2 在 iframe/object 中加载我的页面。但滚动在 iphone 中不起作用。
下面cordova中的config.xml内容
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="*" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="android-targetSdkVersion" value="26" />
<preference name="loadUrlTimeoutValue" value="700000" />
<engine name="android" spec="^7.1.2" />
<engine name="ios" spec="^4.5.5" />
用于 iframe 的代码:
<html lang="en" class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; frame-src 'self'">
<meta name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1, width=device-width" />
</head>
<body style="overflow:hidden; height:100%;">
<div style="overflow:scroll !important; -webkit-overflow-scrolling:touch !important;">
<iframe id="frame-one" data-tap-disabled="true" frameborder="0" src="my-url-website"></iframe>
</div>
</body>
</html>
用于对象标记的代码:
<body style="overflow:hidden; height:100%;">
<div style="overflow:scroll !important; -webkit-overflow-scrolling:touch !important;">
<object id="previllew-frame" style="width:100%;height:100%" data="my-url-website"></object>
</div>
</body>
请帮帮我,谢谢。
【问题讨论】: