我的移动应用程序中有一个滚动列表,我使用离子1.0.1构建。滚动时列表非常不稳定。滚动时,文字会略微模糊。我在手机上查看了Facebook的应用程序,它滚动得非常好,没有劈砍和模糊。我已经创建了一个代码笔,并且想知道我是否可以采取任何措施来提高性能:
http://codepen.io/anon/pen/GJdpRz
HTML:
<html ng-app="mobileApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic List Bug</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.min.js"></script>
</head>
<body ng-controller="MainCtrl">
<ion-content>
<ion-item collection-repeat="item in items">
<div class="list card">
<div class="item item-avatar">
<img src="mcfly.jpg">
<h2>{{item}}</h2>
<p>{{item}}</p>
</div>
<div class="item item-body">
<img class="full-image" src="delorean.jpg">
<p>
{{item}}
</p>
<p>
<a href="#" class="subdued">1 Like</a>
<a href="#" class="subdued">5 Comments</a>
</p>
</div>
<div class="item tabs tabs-secondary tabs-icon-left">
<a class="tab-item" href="#">
<i class="icon ion-thumbsup"></i> Like
</a>
<a class="tab-item" href="#">
<i class="icon ion-chatbox"></i> Comment
</a>
<a class="tab-item" href="#">
<i class="icon ion-share"></i> Share
</a>
</div>
</div>
</ion-item>
</ion-content>
</body>
</html>
JS:
angular.module('mobileApp', ['ionic'])
.config(function($ionicConfigProvider) {
if (!ionic.Platform.isIOS()) $ionicConfigProvider.scrolling.jsScrolling(false);
})
.controller('MainCtrl', ['$scope', function($scope) {
$scope.items = [];
for (i = 0; i < 10; i++) {
$scope.items.push("Item " + i);
}
}]);
答案 0 :(得分:1)
我们现在无法做很多事情,但是现在你可以把它作为你的.config
,这将允许原生滚动。我确实看到了滚动性能的提升。
.config(function($ionicConfigProvider) {
if(!ionic.Platform.isIOS())$ionicConfigProvider.scrolling.jsScrolling(false);