Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 爱奥尼亚滚动顶部“;无法读取属性';滚动至';“无效”的定义;(仍存在于1.0.0-rc.1中)_Ionic Framework - Fatal编程技术网

Ionic framework 爱奥尼亚滚动顶部“;无法读取属性';滚动至';“无效”的定义;(仍存在于1.0.0-rc.1中)

Ionic framework 爱奥尼亚滚动顶部“;无法读取属性';滚动至';“无效”的定义;(仍存在于1.0.0-rc.1中),ionic-framework,Ionic Framework,此处引用了此错误: 答案是这个bug在beta-13中被修复了,但是我使用的是1.0.0-rc.1,这个bug仍然出现 在我的例子中,当导航回使用$ionicScrollDelegate.scrollTop() 更新到rc.1后是否有其他人出现此错误 编辑: 我发现,如果在加载视图时不自动调用$ionicScrollDelegate.scrollTop(),则不会出现错误。我是否应该在等待正确时间的特定Ionic事件中调用scrollTop()?也有同样的问题,即使是v1.0.0“铀独角兽” 将

此处引用了此错误:

答案是这个bug在beta-13中被修复了,但是我使用的是1.0.0-rc.1,这个bug仍然出现

在我的例子中,当导航回使用
$ionicScrollDelegate.scrollTop()

更新到rc.1后是否有其他人出现此错误

编辑:
我发现,如果在加载视图时不自动调用
$ionicScrollDelegate.scrollTop()
,则不会出现错误。我是否应该在等待正确时间的特定Ionic事件中调用
scrollTop()

也有同样的问题,即使是v1.0.0“铀独角兽”

将滚动调用包装为$timeout有帮助-这是我的代码中的样子:

   $timeout(function() {
                $ionicScrollDelegate.scrollTo(scrollPosition.left, scrollPosition.top);
            }, 0);
你可以把它放进去

$ionicPlatform.ready(function () {
    $ionicScrollDelegate.scrollTop();
})

值得一提的是,我在这个线程上看到了这个解决方案,它在版本1.0.0-beta.14中对我有效

如果不选择升级到1.0.0-beta.14版,则可以使用以下内容更改ionic-bundle.js文件:

大约第39910行:

this.scrollTop = function(shouldAnimate) {
  this.resize().then(function() {
    if(typeof scrollView !== 'undefined' && scrollView !== null){
     scrollView.scrollTo(0, 0, !!shouldAnimate);
    }
  });
};
大约第39813行:

if (!angular.isDefined(scrollViewOptions.bouncing)) {
  ionic.Platform.ready(function() {
    if(!scrollView){
      return;
    }
    scrollView.options.bouncing = true;

    if(ionic.Platform.isAndroid()) {
      // No bouncing by default on Android
      scrollView.options.bouncing = false;
      // Faster scroll decel
      scrollView.options.deceleration = 0.95;
    }
 });
}

我迟到了,但收到了相同的错误,但通过调用scroll top元素:

$ionicScrollDelegate.scrollTop();
而是:

var scrollTop = e.detail.scrollTop;
并使用以下方法修复了我的问题:

var scrollTop=$ionicScrollDelegate.getScrollPosition().top

我也在使用js滚动,因为它似乎与scrolla sista插件配合得更好,所以我在我的应用程序开始的
config
块中有以下内容

  $ionicConfigProvider.scrolling.jsScrolling(true);
其中:

我希望这有助于某人

请改变

e、 详细信息。滚动顶部

e、 target.scrollTop


然后这就行了

我刚从rc.0升级到rc.2,突然出现了这个错误。然而,我甚至不相信我在使用爱奥尼亚的任何滚动方法。。。
Whether to use JS or Native scrolling. Defaults to native scrolling. Setting this to true has the same effect as setting each ion-content to have overflow-scroll='false'.