-
-
Save stonehippo/2344029 to your computer and use it in GitHub Desktop.
/* | |
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]; |
funnily (or not) the old key "webviewbounce" is still present in cordova / phonegap 3.0.x this needs to be changed to "DisallowOverscroll" as it's apparently deprecated (no hints there...?) - cost me a few minutes just now. so maybe this helps someone else.
It worked, but in my application I need to scroll down/up, but without the rubber band rubber-band, and with this the overflow content is not visible, and I can`t scrolldow, does anybody know how to fix this?
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];
}
@olimungo DisallowOverscroll is the new key. The old key is actually webviewbounce, so @javierdechile's example should have read:
Either value will work, though I recommend using the newer value as the older one is deprecated.