Phonegap垂直滚动 [英] Phonegap vertical scroll

查看:94
本文介绍了Phonegap垂直滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为ios构建一个phonegap应用程序,并有垂直滚动问题。似乎有一些像素在webview中滚动,甚至没有任何内容,这影响我的绝对定位的导航栏和制表符html的标签栏

I am building a phonegap app for ios and have vertical scroll issue. There appears to be a few pixels scroll in the webview even without any content and this is affecting my absolutely positioned nav bar and tab bar built in html

这里是html页面我有 - 没有内容我仍然得到图像中显示的滚动量:

Here is the html page I have - there is no content by I still get the scroll amount shown in the image:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <title>My App</title>
    </head>
    <body>

        <script src="scripts/vendor/cordova-2.4.0.js"></script>
    </body>
</html>

推荐答案

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

<meta name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1, width=device-width" />

在config.xml中:

And in config.xml:

<preference name="DisallowOverscroll" value="true" />

以上是我发现在iOS上处理滚动的最佳开始。然后,只需添加overflow:auto到任何你需要滚动的元素。使用推翻或iscroll来帮助支持iOS<如图5所示, 3,等等。

Above are settings I found to be the best start for handling scroll on iOS. Then, just add 'overflow: auto' to any element you need to scroll. Use overthrow or iscroll to help support iOS < 5, android < 3, and and so on.

这篇关于Phonegap垂直滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆