-
-
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]; |
in the lastest version have to edit the config.xml file:
<preference name="UIWebViewBounce" value="false" />
Adding "UIWebViewBounce" didn't worked. I changed DisallowOverscroll in PhoneGap 2.0.7 and it worked for me:
<preference name="DisallowOverscroll" value="true" />
in config.xml
@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.
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];
}
Of course, there's a standard way to do this build into Cordova (duh). Set the value of the UIWebViewBounce key in Cordova.plist to "NO" to turn off the rubber-band bounce.
Not sure what version of PhoneGap/Cordova that showed up in.