问题
PhoneGap version: 2.9
Test device: 3gs with iOS 6.1.3
I'm using the PhoneGap build service provided by Adobe
I want to prevent the whole app from overscrolling. I've read the related questions and added the following to my config.xml
<preference name="DisallowOverscroll" value="true" />
<preference name="UIWebViewBounce" value="false" />
which has no effect.
What am I doing wrong?
回答1:
Finally found it: it's webviewbounce not UIWebViewBounce
<preference name="webviewbounce" value="false" />
PhoneGap Build will translate this to DisallowOverscroll.
See http://community.phonegap.com/nitobi/topics/2_7_0_webview_bounce_bug for discussion.
回答2:
I am using PhoneGap version 3.0.0
I had to do two things to get this working:
Firstly: I had this set in my index.html:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
Needed to change this to:
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=medium-dpi" />
When setting device height, my 100% heights were taking into consideration the status bar.
I then also had to add this line into my config.xml:
<preference name="DisallowOverscroll" value="true" />
Hope this helps,
Ian
来源:https://stackoverflow.com/questions/17550704/phonegap-ios-prevent-overscroll