简体   繁体   中英

Remove iOS scroll bounce in ionic 3

I'm developing an Hybrid app for both iOS and Android using ionic-3 .

On Android, when the user reaches the bottom of the page, the scrolling stops. On iOS, when the user reaches the bottom of the page it “bounces” past the end of the page and shows a white background. I don't want it to do this - the background of my page is dark grey, and this overscroll looks terrible.

I've already added the following three lines to the config.xml file:

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

But they don't have any effect.

What else can I do to prevent this over-scroll, bounce effect?

Finally i got solution.

Method 1

I need to add 3 attribute to my ion-content tag

  • no-bounce
  • List item
  • forceOverscroll="false"

Add as like below.

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

Method 2

Simply run npm i ionic-angular@3.9.4-201903121725 in your project's directory :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM