防止Cordova在Windows Phone 8中滚动出CordovaView [英] Prevent scrolling out of CordovaView in Cordova for Windows Phone 8
问题描述
在Windows Phone 8 Cordova应用程序中,我可以在应用程序中水平点击和拖动,并平移/滚动显示的水平边缘。请参阅Cordova Windows Phone 8独立模板应用程序:
In a Windows Phone 8 Cordova application I'm able to click and drag horizontally in the app and pan/scroll past the horizontal edge of the display. See the Cordova Windows Phone 8 standalone template application:
这个模板应用程序后面的HTML具有适当的视口规范,就我所见:
The HTML behind this template application has a proper viewport specification, as far as I can see:
<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" />
此错误可防止任何滑动手势检测。 iOS UIScrollView控件有一个
This bug prevents any kind of swipe gesture detection from being useful. The iOS UIScrollView control has a bounces
property that allows a somewhat similar effect to be canceled.
推荐答案
body
标签的额外CSS属性修复了独立模板应用程序和我正在处理的原始应用程序中的平移问题:
Two extra CSS properties on the body
tag fixed the panning problem in both the standalone template app and in the original app I was working on:
body {
overflow: hidden;
-ms-content-zooming: none; }
此 ms-content-zooming
属性不限制作为 body
元素的子元素的垂直滚动。
This ms-content-zooming
property does not restrict vertical scrolling within elements that are children of the body
element.
这篇关于防止Cordova在Windows Phone 8中滚动出CordovaView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!