我正在为 ios 构建一个phonegap 应用程序,并且遇到垂直滚动问题。即使没有任何内容,网络视图中似乎也会有一些像素滚动,这会影响我在 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>
滚动截图http://img20.imageshack.us/img20/5140/screenshot20130225at212.png 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”添加到需要滚动的任何元素即可。使用 overthroll 或 iscroll 来帮助支持 iOS
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)