Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable content bouncing scroll

In my hybrid app there's a possibility to drag the screen to refresh the list. In Android this works fine, but on iOS when I'm dragging down it sometimes confuses it with scrolling the page so it has that overflow/bouncing effect.

In ionic there's an attribute you can use to disable this, but it's not working:

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

config.xml already has these lines of code:

  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
like image 309
Greg Avatar asked Feb 22 '16 13:02

Greg


3 Answers

Solution for Ionic 2:

<ion-content no-bounce>
like image 134
Goalie Long Avatar answered Nov 09 '22 13:11

Goalie Long


You will need to set overflow-scroll to false like :

overflow-scroll="false"

Works on Ionic 1.3

like image 36
radioaktiv Avatar answered Nov 09 '22 14:11

radioaktiv


on ionic 4 <ion-content no-bounce has-bouncing="false" forceOverscroll="false">. If this fail force to remove bounce with.

To remove and force the not bounce in the component ion-content on ios, create the file DisableBounce.m With the following content.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@implementation UIScrollView (NoBounce)
- (void)didMoveToWindow {
    [super didMoveToWindow];
    self.bounces = NO;
}
@end

and to save on platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine. this disable all efect bounce in you app.

like image 37
Leonardo Pineda Avatar answered Nov 09 '22 14:11

Leonardo Pineda