我们通过设置 $location.hash(id)
在 ionic 应用程序中使用 scrollTo 功能和 $anchorScroll()
.滚动到底部工作正常,但是一旦页面使用 $anchorScroll
滚动到某个位置,我们就无法向上滚动页面。和 $location.hash()
.
在codepen中看清楚问题.单击到底部按钮并尝试向上滚动。
请提供解决此滚动问题的解决方案。
最佳答案
在“ ionic 内容”div 上添加溢出滚动=“真”
<ion-content overflow-scroll="true">
然后在您的 Controller 中:
$scope.scrollTo = function(id) {
$location.hash(id);
$ionicScrollDelegate.anchorScroll();
};
可以在此处找到有关 Ionic Framework 中此问题的更多信息:
http://forum.ionicframework.com/t/content-stuck-after-anchorscroll/776
关于angularjs - ionic : Can't scroll up while using anchorScroll in ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28564189/