To disable bouncing effect in ios scroll ionic 3

£可爱£侵袭症+ 提交于 2020-01-23 04:41:07

问题


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.


回答1:


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

<ion-content no-bounce has-bouncing="false" forceOverscroll="false">



回答2:


For ionic 4

<ion-content forceOverscroll="false">

Just using forceOverscroll="false" worked for me, the docs say do the opposite




回答3:


I solved my problem with this:

<ion-content scrollY="false">



回答4:


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



来源:https://stackoverflow.com/questions/46300066/to-disable-bouncing-effect-in-ios-scroll-ionic-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!