gpt4 book ai didi

cordova - Phonegap垂直滚动

转载 作者:行者123 更新时间:2023-12-03 18:16:18 24 4
gpt4 key购买 nike

我正在为 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>

scroll screenshot http://img20.imageshack.us/img20/5140/screenshot20130225at212.png

最佳答案

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 中:
<preference name="DisallowOverscroll" value="true" />

以上是我发现在 iOS 上处理滚动的最佳开始的设置。然后,只需将 'overflow: auto' 添加到您需要滚动的任何元素。使用overthrow 或iscroll 帮助支持iOS < 5、android < 3 等等。

关于cordova - Phonegap垂直滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15076873/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com