Created
April 9, 2012 14:54
-
-
Save stonehippo/2344029 to your computer and use it in GitHub Desktop.
Prevent UIWebview "rubber band" scrolling in Phonegap apps on iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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];
}