Stopping overscroll / bounce in Phonegap IOS

前端 未结 20 1445
青春惊慌失措
青春惊慌失措 2020-12-07 18:53

I am using the latest version of Phonegap on IOS (ipad) and I can\'t seem to disable the vertical overscroll/bounce on the whole app. I don\'t mind it on inner elements but

相关标签:
20条回答
  • 2020-12-07 19:16

    DisallowOverscroll does not work for me.

    Solution is to ensure that there is nowhere to scroll.

    For example, in my case it was div wider (it can be higher) than the body like below:

    <body>
      <div style="margin: 5%" width: 95%;>something</div>
    </div>
    

    Now, above div is 5% bigger than body that cause scrolling. Set width to 90% fixes the issue.

    0 讨论(0)
  • 2020-12-07 19:17

    In config.xml of your project, under preferences for iOS set DisallowOverscroll to true.

    <preference name="DisallowOverscroll" value="true" />
    
    0 讨论(0)
  • 2020-12-07 19:17

    Try This One If you are ionic framework user Abc.html file inside content.

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

    0 讨论(0)
  • 2020-12-07 19:18

    The accepted answer did not work for me, I had to set UIWebViewBounce to false:

    <preference name="UIWebViewBounce" value="false" />
    
    0 讨论(0)
  • 2020-12-07 19:20

    Thanks For All answer. But If you have issue in windows Phone here is the solution. Just go to MainPage.xaml.cs file and replace below function..

    public MainPage()
        {
            InitializeComponent();
            this.CordovaView.DisableBouncyScrolling = true;
            this.CordovaView.Loaded += CordovaView_Loaded;
        }
    

    Its works for me :)

    0 讨论(0)
  • 2020-12-07 19:20

    For Cordova 7 and an iPhone 7 + iOS 11.0.3, modifying the root-directory config.xml and adding this worked beautifully:

    <platform name="ios">
        <preference name="DisallowOverscroll" value="true" />
        <preference name="UIWebViewBounce" value="false" />
        ... (other stuff) ...
    </platform>
    
    0 讨论(0)
提交回复
热议问题