【问题标题】:native scrolling not working on ionic本机滚动不适用于离子
【发布时间】:2015-07-21 16:20:17
【问题描述】:

我正在尝试像这样使用本机滚动:

angular.module('MyApp').config(function ($translateProvider,$ionicConfigProvider) {

    $translateProvider.preferredLanguage('en');
    $translateProvider.useStaticFilesLoader({
        prefix: 'languages/',
        suffix: '.json'
    });
    if(!ionic.Platform.isIOS())$ionicConfigProvider.scrolling.jsScrolling(false);
})

我的滚动停止工作的问题非常类似于:code pen

我的模板:

 <div class="list">
        <a ng-repeat="item in items" class="item card"
           href="#/tab/details/{{item.queId}}">
                <div class="row">....

感谢您的帮助!

查看后看来问题只发生在 chrome....

【问题讨论】:

    标签: scroll ionic-framework ionic


    【解决方案1】:

    原生滚动仅适用于 Android 平台。

    您可以在最近的一篇博文here 和论坛here 中了解更多信息。

    你使用的语法没问题:

    if (!ionic.Platform.isIOS()) {
        $ionicConfigProvider.scrolling.jsScrolling(false);
      }
    

    但你只能在安卓设备上测试它。

    【讨论】:

      【解决方案2】:

      没有这行代码,你的 codepen 可以正常滚动:

      if(!ionic.Platform.isIOS())$ionicConfigProvider.scrolling.jsScrolling(false);
      

      你为什么用这段代码在非 iOS 平台上禁用滚动?

      【讨论】:

        猜你喜欢
        • 2017-04-11
        • 1970-01-01
        • 2017-12-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多