How to prevent bounce of PhoneGap app container in iOS apps – UIWebViewBounce

May 14, 2012 | By

I’ve noticed that a lot of apps built with PhoneGap have a weird behavior on iPhone and iPad — You can tug at the main app and move it around slightly and let it bounce back into place.  It’s as if the PhoneGap container is connected to the device with springs!  I quickly found several solutions to the problem, some of which require either catching the JavaScript touchStart event at the top-level, or modifying the PhoneGap code.

However, I also discovered that starting with PhoneGap 1.5 (release notes), a new key was added to the PhoneGap.plist (now Cordova.plist) called UIWebViewBounce.  It’s set to YES by default (I have no idea why).  If you set it to NO, your app will be anchored in with nails and the bounce removed.

This is also now configurable with PhoneGap Build by setting webviewbounce to false in your config.xml (documented here).


Filed in: iOS/iPhone/iPad, PhoneGap | Tags: , , ,

About the Author (Author Profile)

Greg is a developer advocate for the Google Cloud Platform based in San Francisco, California
  • shazron

    The default is set to YES to not break existing apps (as would be the case for introducing any new property, we would err on not breaking things).