Skip to content

Instantly share code, notes, and snippets.

@stonehippo
Created April 9, 2012 14:54
Show Gist options
  • Save stonehippo/2344029 to your computer and use it in GitHub Desktop.
Save stonehippo/2344029 to your computer and use it in GitHub Desktop.
Prevent UIWebview "rubber band" scrolling in Phonegap apps on iOS
/*
Inserting the following into application:didFinishLaunchingWithOptions: in
the AppDelegate.m of your app will prevent the parent UIWebview for scrolling
with the "rubber band" bouncing effect, which can make the app feel more native.
*/
// Prevent the webview rubber-banding behavior (but allow other stuff to scroll)
[[[self.viewController.webView subviews] lastObject] setScrollEnabled:NO];
@mnyamor
Copy link

mnyamor commented Jul 18, 2014

I'm using cordova version 3.5.0-0.2.6 and been having the same issue. This however seemed to fix the issue.
on your "CDVViewController.m file , you should add this when you Instantiate the WebView

if (!self.webView) {
[self createGapView];
webView.delegate = self;
webView.scalesPageToFit = YES;
[[webView scrollView] setBounces:NO];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment