Cordova Phonegap垂直滚动

Cordova Phonegap垂直滚动,cordova,Cordova,我正在为ios构建一个phonegap应用程序,并且存在垂直滚动问题。即使没有任何内容,webview中也会出现一些像素的滚动,这会影响我的绝对定位导航栏和html内置的选项卡栏 这是我的html页面-没有任何内容,但我仍然获得图像中显示的滚动量: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <

我正在为ios构建一个phonegap应用程序,并且存在垂直滚动问题。即使没有任何内容,webview中也会出现一些像素的滚动,这会影响我的绝对定位导航栏和html内置的选项卡栏

这是我的html页面-没有任何内容,但我仍然获得图像中显示的滚动量:

<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>

我的应用程序
这可能会有帮助:

正文{
身高:100%;
溢出:隐藏;
}
这为我解决了这个问题(至少在iOS上-可能在其他平台上有其他兼容性)

尝试从顶部的元中删除
width=devicewidth,height=deviceheight

据我所知,这是一个设备没有考虑顶部状态栏的问题。

html,body{
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" />
保证金:0; 填充:0; 身高:100%; 溢出:隐藏; }
在config.xml中:

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


以上是我发现在iOS上处理scroll的最佳开始设置。然后,只需将“溢出:自动”添加到需要滚动的任何元素中。使用Turple或iscroll来帮助支持iOS<5、android<3等。

以上任何一项都不能解决我的问题,只能在下面链接。在我的例子中,内容下方有一个无法解释的过度间隙,这个间隙导致了滚动条

以下是链接:

试着隐藏系统托盘,它帮了我的忙

在MainPage.xaml上,将“IsVisible”设置为false

shell:SystemTray.IsVisible="False" d:DesignHeight="768" d:DesignWidth="480"
对于最新的答案(截至2016年),这个解决方案是我在Cordova iOS中最有效的(平滑滚动)

.element {
  overflow-y: scroll; /* has to be scroll, not auto */
  -webkit-overflow-scrolling: touch;
}
资料来源:

您好,我已经试过了,似乎新安装的phonegap也有这个问题。太棒了!这似乎解决了这个小问题。我几乎准备完全放弃phonegap——我一直在努力为这个问题寻找解决方案。哈哈!谢谢你。为了找到它,我失去了一个晚上。Peskt装置高度。我在没有正确研究的情况下粘贴了一个建议的meta标签,这对我来说是一件好事。