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
Below solution worked for me : Tested only ionic 3.9 version
Run command,
@implementation UIScrollView (NoBounce)
- (void)didMoveToWindow {
[super didMoveToWindow];
self.bounces = NO;
}
@end
For Ionic 4, use:
<ion-content [scrollY]="false">...</ion-content>
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.
I'm upgrading from Ionic 3 to Ionic 5 and found this post. But then just found the solution in documentation.
I'm using Ionic 5 (not sure if Ionic 4 works too). Just add slot="fixed"
to element inside ion-conent
:
<ion-content
[scrollEvents]="true"
(ionScrollStart)="logScrollStart()"
(ionScroll)="logScrolling($event)"
(ionScrollEnd)="logScrollEnd()">
<h1>Main Content</h1>
<div slot="fixed">
<h1>Fixed Content</h1>
</div>
</ion-content>
It works perfect in iOS.
Source: https://ionicframework.com/docs/api/content