如果首次访问视图,由于某些原因,data数组为空,于是tableView活着CollectionView是不可见的,自然也不能进行上拉,下拉动作,目前想到的是在viewdidapplear中执行刷新

    [tableViewtriggerPullToRefresh];

对于collectionview 上拉加载成功后 如果reloaddata collectionview 会自动回到top,这样想要看新数据又要不断往下拉,很苦恼



原因找到 

        if (weakSelf.collectionView.pullToRefreshView) {

            [weakSelf.collectionView.pullToRefreshView stopAnimating];

        }

        if (weakSelf.collectionView.infiniteScrollingView) {

            [weakSelf.collectionView.infiniteScrollingView stopAnimating];

        }


因为.pullToRefreshView是一直在 如果执行 [weakSelf.collectionView.pullToRefreshView stopAnimating];则会返回头部

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐