Stop scrolling / bounce in Phonegap iOS

I am using the latest version of Phonegap on iOS (ipad) and I cannot disable vertical overload / bounce in the whole application. I am not opposed to this in the internal elements, but it looks rather strange when you scroll up or down and the whole application bounces up and down.

I tried setting UIWebViewBounce to no in .plist, but it seems to have done nothing.

Rate the help :)

+46
cordova
Apr 29 '13 at 8:18
source share
17 answers

You need to change the property in the config.xml file. Just set the following preference to true

 <preference name="DisallowOverscroll" value="true" /> 
+158
Apr 29 '13 at 9:00
source share

The accepted answer did not work for me, I had to set UIWebViewBounce to false :

 <preference name="UIWebViewBounce" value="false" /> 
+16
Jun 15 '13 at 6:21
source share

now for phonegap 3.0 higher version use below syntex in config.xml file and it will work 100%

 <preference name="DisallowOverscroll" value="true"/> 
+13
Dec 23 '13 at 7:41
source share

If you add <preference name="DisallowOverscroll" value="true"/> to config.xml with no luck, you may modify the wrong file. Instead, search the entire directory of your phone book for "DisallowOverscroll." You must find several instances. Change them to true.

Greetings.

+6
Jan 04 '14 at 21:18
source share

If nothing works, try removing -webkit-overflow-scrolling: touch from your css ... if you have it!

+4
Mar 28 '15 at 22:49
source share

Use this method: -

 function disallowOverscroll(){ $(document).on('touchmove',function(e){ e.preventDefault(); }); $('body').on('touchstart','.scrollable',function(e) { if (e.currentTarget.scrollTop === 0) { e.currentTarget.scrollTop = 1; } else if (e.currentTarget.scrollHeight === e.currentTarget.scrollTop + e.currentTarget.offsetHeight) { e.currentTarget.scrollTop -= 1; } }); $('body').on('touchmove','.scrollable',function(e) { e.stopPropagation(); }); } disallowOverscroll(); 

For more information or tips and tricks read in this article click

+4
Jan 12 '16 at 10:49 on
source share

There is a way that I used this. but it is not ordinary as it deals with internal coding. There is a webViewDidFinishLoad method in MainViewController. Enable this theWebView.scrollView.bounces = NO;

inside this method.

 - (void)webViewDidFinishLoad:(UIWebView*)theWebView { // Black base color for background matches the native apps theWebView.backgroundColor = [UIColor blackColor]; theWebView.scrollView.bounces= NO; return [super webViewDidFinishLoad:theWebView]; } 

Since this is the native ios code, it will work on any phonegap / cordova distribution.

+3
Jun 16 '14 at 9:42 on
source share

this is what worked for my phone 3.0 application: add the following line to config.xml

 <preference name="webviewbounce" value="false"/> 
+2
Oct 10 '13 at 10:35 on
source share

In the config.xml of your project, in the settings for iOS, set DisallowOverscroll to true. By default, it is false, which makes the entire scroll view along with the internal elements of the view.

 <preference name="DisallowOverscroll" value="true" /> 
+2
May 02 '14 at 5:35
source share

In the config.xml of your project, in the iOS settings, set DisallowOverscroll to true.

 <preference name="DisallowOverscroll" value="true" /> 
+2
Jun 13 '14 at 16:28
source share

Thanks for the answer. But if you have a problem in Windows Phone, here is the solution. Just go to the MainPage.xaml.cs file and replace the function below.

 public MainPage() { InitializeComponent(); this.CordovaView.DisableBouncyScrolling = true; this.CordovaView.Loaded += CordovaView_Loaded; } 

His work is for me :)

+2
Jun 09 '15 at 7:48
source share

I had a similar problem, but I could not fix it with all the solutions that I have found so far (e.g. editing config.xml).

But finally, just by editing the CSS property of the body, he committed:

 html,body { overflow: auto; height:100%; } 
+2
Jul 27 '16 at 4:13
source share

Try this if you are a user of the abc.html file of the iicic framework user inside the content.

<ion-content has-bouncing="false">

+2
Aug 05 '16 at 11:57
source share

Use this:

 <preference name="UIWebViewBounce" value="false" /> 
+1
Jun 15 '13 at 6:26
source share

It worked for me. Try adding this code to the config.xml file of your phonegap application:

<preference name="DisallowOverscroll" value="true">

+1
Sep 12 '14 at 7:04
source share

It is better to change the two elements in the config.xml file as follows:

 <preference name="DisallowOverscroll" value="true"/> <preference name="UIWebViewBounce" value="false" /> 
+1
Dec 24 '15 at 4:45
source share

Open xCode -> find and click on config.xml from the menu on the left -> and change the DisallowOverscroll value false to true Or use this code, replacing the previous one.

  <preference name="DisallowOverscroll" value="true" /> 
0
Sep 06 '17 at 6:06
source share



All Articles