【问题标题】:Phonegap iOS app screen slides up on double tapPhonegap iOS 应用程序屏幕在双击时向上滑动
【发布时间】:2012-10-01 13:09:35
【问题描述】:

我正在为 iOS 开发一个 phonegap 应用程序。当我双击屏幕底部时,主屏幕向上滑动。这只发生在纵向模式下。

我已经尝试禁用滚动.. 但没有奏效。这是我的 html 代码:

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0 " />
<body>
<div class="mainScreenContent" align="center">
<table>
<form>
<tbody>
<tr >
<td>
<button type="submit" class="largeButton grayGradientEffect">Button 1</button>
</td>
</tr>
<tr>
<td >
<button type="submit" class="largeButton grayGradientEffect" onclick="">Button 2</button>
</td>
</tr>
</tbody>
</form>
</table>
</div>
</body>

这里是屏幕截图:

这是主屏幕的样子:

这是双击底部后的样子:

感谢大家的帮助。

【问题讨论】:

    标签: iphone ios html cordova


    【解决方案1】:

    如果您使用的是 jquery,请拦截此事件。

    以下 Johan Sundström 的解决方案

    https://gist.github.com/2047491

    要使用,请将以上内容添加到您的 javascript。然后拦截任何合适的元素。

    例如

    $("body").nodoubletapzoom();
    

    【讨论】:

    • 这很好用。我不得不在 DIV 而不是 body 上调用它,以防止一些 CSS 违规行为。
    【解决方案2】:

    您可以尝试将以下内容添加到您的元视口查询中吗?

    user-scalable=0 
    

    【讨论】:

      猜你喜欢
      • 2016-10-11
      • 2021-02-26
      • 1970-01-01
      • 1970-01-01
      • 2015-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-18
      相关资源
      最近更新 更多