Disable content scrolling

In my application hybridthere is the ability to drag the screen to refresh the list. In Androidthis works fine, but iOSwhen I drag it, it is sometimes confused with the page scrolling so that it had the effect of the overflow / rebound.

There ionicis an attribute in there that you can use to disable this, but it does not work:

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

config.xml already has the following lines of code:

  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
+6
source share
7 answers

You will need to set the overflow-scrollvalue falsefor example:

overflow-scroll="false"

Powered by Ionic 1.3

+5
source

Solution for Ionic 2:

<ion-content no-bounce>
+20

Ionic 4 :

<ion-content [scrollY]="false">...</ion-content>
+3

overflow-scroll="false" no-bounce has-bouncing="false". ionic conference ..

cli packages: (/Users/lucky/Documents/projects/ionic-conference/ node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

:

Cordova CLI : 7.0.1 

:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.3.1
Ionic Framework    : ionic-angular 3.6.1

:

ios-deploy : 1.9.1 
ios-sim    : 6.0.0 
Node       : v6.9.5
npm        : 5.4.0 
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 

xcode- iPhone 6 Plus

+2

ionic 1.3.2, :

  <preference name="webviewbounce" value="false" />
  <preference name="UIWebViewBounce" value="false" />
  <preference name="DisallowOverscroll" value="true" />

has-bouncing="false" ion-content. , , . : iOS android.

, -.

+2

.scroll-content { -webkit-overflow-scrolling: auto !important; }

add it to the scss file.

+1
source

on ion 4 <ion-content no-bounce has-bouncing="false" forceOverscroll="false">. If this fails to force reset to.

To remove and force non-failure in component ion content on ios, create a file DisableBounce.m with the following contents.

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

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

and save on the platforms / ios / CordovaLib / Classes / Private / plugins / CDVUIWebViewEngine. This will disable all Efect Bounce in your application.

+1
source

Source: https://habr.com/ru/post/1629890/


All Articles