[英]$ionicScrollDelegate.scrollTop() doesn't allow me to scroll up manually after it scrolls down my list
I have a problem with using $ionicScrollDelegate.scrollTop() I need to scroll down my book list to appropriate book after going out from the reader. 我有使用$ ionicScrollDelegate.scrollTop()的问题我需要在从读者出去后向下滚动我的图书清单到适当的书。 I desided to use $ionicScrollDelegate.scrollTop() for this purpose.
为此,我决定使用$ ionicScrollDelegate.scrollTop()。 It works, but I cannot scroll up my list manually after that.
它有效,但在此之后我无法手动向上滚动列表。
Maybe someone knows why it happens. 也许有人知道它为什么会发生。
Here is my code: 这是我的代码:
$timeout(function(){
var BooksListScroll = $ionicScrollDelegate.$getByHandle('BooksListScroll');
$location.hash("main" + $rootScope.currentBookCode);
BooksListScroll.scrollTop(true);
}, 500);
If you are using android platform to do a test, remove the 'true' value on the function. 如果您使用android平台进行测试,请删除该函数上的“true”值。 Ex:
例如:
BooksListScroll.scrollTop(true);
to 至
BooksListScroll.scrollTop();
Do a try.. IOS is working fine with the scroll animation but on android the scroll animation make the view freeze! 试一试.. IOS与滚动动画工作正常但在Android上滚动动画使视图冻结! Weird!
奇怪的! :(
:(
UPDATE (SOLUTION): 更新(解决方案):
Okay I found the solution.. It seem we need to set 'jsScrolling: true' instead of by default is 'jsScrolling: false' for android. 好吧,我找到了解决方案..似乎我们需要设置'jsScrolling:true'而不是默认为'jsScrolling:false'为android。
Please modified/edit this on 'ionic-angular.js' 请在'ionic-angular.js'上修改/编辑
Hope it help others :) 希望它能帮到别人:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.