尝试通过此代码减慢滚动速度时遇到问题:
$ionicScrollDelegate.$getByHandle('credit').scrollBottom(true).
我怎样才能减慢滚动速度?因为现在它对我来说滚动得太快了。我需要放慢滚动速度,就像星球大战电影中的信用场景一样。
Anyhelp将不胜感激,谢谢!
$scope.viewCreditsV2 = function () {
$ionicModal.fromTemplateUrl('views/popupcredit.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
$scope.modal.show();
if ($scope.modal.isShown()){
setTimeout(function() {
// Do something after 2 seconds
$ionicScrollDelegate.$getByHandle('credit').scrollBottom(true);
}, 2000);
}
});
$scope.openModal = function() {
$scope.modal.show();
};
$scope.closeModal = function() {
// $scope.modal.hide();
$scope.modal.remove();
};
};
最佳答案
这个问题很老,但有人可能会使用它。
即使没有参数传递选项,您仍然可以使用 $ionScrollDelegate
访问 ScrollView 对象。 .
按照@Jeremy Wilken 的回答(它帮助我得出了这个答案),你可以这样做:
$timeout(function() {
$ionicScrollDelegate.getScrollView().options.animationDuration = 400;
console.log($ionicScrollDelegate.getScrollView().options);
});
//.....
$ionicScrollDelegate.scrollBy(0,20, true) // Animation will be slower now
我通过
$timeout
结束了通话避免来自 $ionicScrollDelegate
的赛车状况没有被创建。
关于ionic-framework - ionic 降低滚动速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29742525/