Something that completely destroys the look and feel of native apps is when you drag the app and it bounces. Total give away that it's a web app.
I've found a few good methods that prevent this, but there is no way to do it on text inputs and textareas.
If there could be someway for you to turn this off, in config.xml, this would be amazing.
Please, please please look into this!
Thanks,
Jason
I've found a few good methods that prevent this, but there is no way to do it on text inputs and textareas.
If there could be someway for you to turn this off, in config.xml, this would be amazing.
Please, please please look into this!
Thanks,
Jason
- 63 Posts
- 4 Reply Likes
Posted 9 years ago
- 1911 Posts
- 199 Reply Likes
- 4 Posts
- 0 Reply Likes
How far is the implementation of this idea? We really need this, because the scroll-bounce completely destroys the feeling of a nativ App.
- 1911 Posts
- 199 Reply Likes
This has been implemented now, as documented here:
https://build.phonegap.com/docs/confi...
To disable the bounce, add the following tag to your config.xml file:
Please note this is only supported in apps running on PhoneGap 1.3.0 (and above)
https://build.phonegap.com/docs/confi...
To disable the bounce, add the following tag to your config.xml file:
<preference name="webviewbounce" value="false" />
Please note this is only supported in apps running on PhoneGap 1.3.0 (and above)
- 63 Posts
- 4 Reply Likes
Btw it works perfectly! This is a huge improvement.
Thanks so much for the awesome service and support.
Thanks so much for the awesome service and support.
- 4 Posts
- 0 Reply Likes
The config.xml is only for https://build.phonegap.com/
How can I use this Option when i build my App with XCode?
How can I use this Option when i build my App with XCode?
- 1911 Posts
- 199 Reply Likes
I've contributed this PhoneGap patch to callback/cordova-iOS - you can find it here:
https://github.com/alunny/cordova-ios...
To add to a single app, add the following code to the ApplicationDidFinishLaunching method in the AppDelegate.m class:
(this does not allow toggling with a preference - you will need the full patch for that)
https://github.com/alunny/cordova-ios...
To add to a single app, add the following code to the ApplicationDidFinishLaunching method in the AppDelegate.m class:
if ([ self.webView respondsToSelector:@selector(scrollView) ]) {
((UIScrollView *) [self.webView scrollView]).bounces = NO;
} else {
for (id subview in self.webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
}
(this does not allow toggling with a preference - you will need the full patch for that)
- 4 Posts
- 0 Reply Likes
Thanks for your submission to Phonegap! I hope it will be included soon, so we can toggle this via options.
In my AppDelegate.m I can not found a ApplicationDidFinishLaunching methode. There is only a didFinishLaunchingWithOptions, but inserting your sniped there did not change anything. :-(
In my AppDelegate.m I can not found a ApplicationDidFinishLaunching methode. There is only a didFinishLaunchingWithOptions, but inserting your sniped there did not change anything. :-(
- 2 Posts
- 0 Reply Likes
- 1911 Posts
- 199 Reply Likes
Turns out you have to call the super method first - this works for me:
/**
* This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
*/
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
if (url && [url isKindOfClass:[NSURL class]])
{
self.invokeString = [url absoluteString];
}
BOOL superResult = [super application:application didFinishLaunchingWithOptions:launchOptions];
if ([ self.webView respondsToSelector:@selector(scrollView) ]) {
((UIScrollView *) [self.webView scrollView]).bounces = NO;
} else {
for (id subview in self.webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
}
return superResult;
}
- 4 Posts
- 0 Reply Likes
Great! Works like a charm. Thank you so much.
- 12 Posts
- 1 Reply Like
Can I do this in PhoneGap 1.4.1 ?
- 1911 Posts
- 199 Reply Likes
I don't think the patch made it in until PhoneGap 1.5.0 (next week) - you can either wait and upgrade then, or manually update the AppDelegate file, as suggested above.
- 12 Posts
- 1 Reply Like
Thanks Andrew. I could see your pull request wasn't in the latest code base on github, so I have monkey patched for now. Looking forward to 1.5.0.
- 1 Post
- 0 Reply Likes
Works great in 1.5. I didn't have to do anything because it was enabled in the plist file.
- 11 Posts
- 0 Reply Likes
Andrew Lunny latest answer didnt work for me after updating my project from phonegap 2.0.0 to phonegap 2.2.0.
Here, some from AppDelegate.m:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
NSString* invokeString = nil;
if (url && [url isKindOfClass:[NSURL class]]) {
invokeString = [url absoluteString];
NSLog(@"Wildberries launchOptions = %@", url);
}
//custom settings
if ([ self.viewController.webView respondsToSelector:@selector(scrollView) ]) {
((UIScrollView *) [self.viewController.webView scrollView]).bounces = NO;
} else {
for (id subview in self.viewController.webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
}
//custom settings end
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];
self.window.autoresizesSubviews = YES;
......
How can I stop webview bouncing when i build my App with XCode and phonegap 2.2.0?
Here, some from AppDelegate.m:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
NSString* invokeString = nil;
if (url && [url isKindOfClass:[NSURL class]]) {
invokeString = [url absoluteString];
NSLog(@"Wildberries launchOptions = %@", url);
}
//custom settings
if ([ self.viewController.webView respondsToSelector:@selector(scrollView) ]) {
((UIScrollView *) [self.viewController.webView scrollView]).bounces = NO;
} else {
for (id subview in self.viewController.webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
}
//custom settings end
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];
self.window.autoresizesSubviews = YES;
......
How can I stop webview bouncing when i build my App with XCode and phonegap 2.2.0?
- 12 Posts
- 1 Reply Like
- 11 Posts
- 0 Reply Likes
- 1 Post
- 0 Reply Likes
- 1 Post
- 0 Reply Likes
i use Cordova framework and nothing stop bouncing my app for me :(((((((
i dont know what i have to do any more, spent about 5 days and nights around this problem and i can`t figure out. :((((((
1o my plist file dont have any UIWebViewBounce line for i put to NO
2o In my config.xml i all ready try put this:
in my MainViewcontroller.m i all ready try to put this:
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
OUR this
webView.scrollView.bounces = NO;
[[webView scrollView] setBounces: NO];
and dont work... just show me the small bullet error on the left, in xcode and i can`t even run my app in test device (iphone).
I Dont know what i have to do any more :( nothing work for i can enable the horror of bouncing efect.......
cheers :/
i dont know what i have to do any more, spent about 5 days and nights around this problem and i can`t figure out. :((((((
1o my plist file dont have any UIWebViewBounce line for i put to NO
2o In my config.xml i all ready try put this:
in my MainViewcontroller.m i all ready try to put this:
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
OUR this
webView.scrollView.bounces = NO;
[[webView scrollView] setBounces: NO];
and dont work... just show me the small bullet error on the left, in xcode and i can`t even run my app in test device (iphone).
I Dont know what i have to do any more :( nothing work for i can enable the horror of bouncing efect.......
cheers :/
- 8261 Posts
- 263 Reply Likes
This conversation is no longer open for comments or replies.
This conversation is no longer open for comments or replies.
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers





