Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To disable bouncing effect in ios scroll ionic 3

Tags:

angular

ionic3

I tried some methods to disable bounce effect set no-bounce attribute to ion-content

<ion-content no-bounce></ion-content>

And added styles to ion-content to disable bounce. Still no fix to my problem.

like image 347
Abinesh Joyel Avatar asked Sep 19 '17 12:09

Abinesh Joyel


2 Answers

It works on Ionic 4 with this. (Sorry, I don't have an explanation).

<ion-content no-bounce has-bouncing="false" forceOverscroll="false">
like image 133
arc Avatar answered Sep 23 '22 15:09

arc


After couple of hours, I have find an answer from Github issues and I would like to share the solution, which then will disable the bounce effect in the iOS device.

Steps:

  1. Run command, ionic cordova platform add ios && ionic cordova prepare ios
  2. Then find CDVWKWebViewEngine.m, inside /platforms/ios/<ionic-project>/Plugins/cordova-plugin-ionic-webview/
  3. Put this line of code at the bottom of the lines and save it.
@implementation UIScrollView (NoBounce)
- (void)didMoveToWindow {
   [super didMoveToWindow];
   self.bounces = NO;
}
@end

Credit link: https://github.com/ionic-team/ionic-v3/issues/113

Tested on Ionic 4, working on iOS device

like image 41
Snowbases Avatar answered Sep 19 '22 15:09

Snowbases