列表中的IONIC Framework滚动问题

Aad*_*ani 1 cordova ionic-framework

我正在使用离子框架的简单列表视图,它在某些设备中工作正常,而某些设备则隐藏了滚动条.用户无法在某些设备中滚动.许多用户面临同样的问题,他们在这里讨论.

重现同样的问题

创建应用程序

ionic start scrollTest sidemenu

- 修改后的"PlaylistsCtrl"控制器为:

.controller('PlaylistsCtrl', function($scope) {
    $scope.playlists = [
      { title: 'Reggae', id: 1 },
      { title: 'Chill', id: 2 },
      { title: 'Dubstep', id: 3 },
      { title: 'Indie', id: 4 },
      { title: 'Rap', id: 5 },
      { title: 'Cowbell', id: 6 },
      { title: 'Breaks', id: 7 },
      { title: 'Jungle', id: 8 },
      { title: 'Drum & Bass', id: 9 },
      { title: 'Classics', id: 10 },
      { title: 'Blah', id: 11 },
      { title: 'Foo', id: 12 },
      { title: 'Bar', id: 13 },
      { title: 'House', id: 14 },
      { title: 'Trance', id: 15 },
      { title: 'EDM', id: 15 },
      { title: 'Country', id: 16 },
      { title: 'Rock', id: 17 }
    ];
  }) 
Run Code Online (Sandbox Code Playgroud)

- 在playlists.html中设置overflow-scroll为true:

<ion-content class="has-header" overflow-scroll="true">...

- 设备上的应用程序:

ionic run android

...一旦启动,init视图(播放列表)不会滚动...

任何人都可以帮助我解决这个问题,这将是很好的,因为我们无法在不解决这个错误的情况下启动应用程序.

Boo*_*lan 7

使用这个离子js:

<script src="//code.ionicframework.com/nightly/js/ionic.bundle.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

删除 overflow-scroll ="true"

<ion-content class="has-header" overflow-scroll="true">
Run Code Online (Sandbox Code Playgroud)

在app.js中添加此代码

if(ionic.Platform.isAndroid())
    $ionicConfigProvider.scrolling.jsScrolling(false);     
Run Code Online (Sandbox Code Playgroud)

例如:

angular.module('ionicApp', ['ionic']).config(function($ionicConfigProvider)   {
    if (ionic.Platform.isAndroid())
       $ionicConfigProvider.scrolling.jsScrolling(false);
     })
Run Code Online (Sandbox Code Playgroud)

上面的代码与overflow-scroll ="true"做的事情相同.它使用原生滚动而不是jsScroll