UICollectionView: different size items is not calculated on reused items

前端 未结 4 1016
北海茫月
北海茫月 2021-02-13 22:27

I have a collection view with varied item sizes which i declare in

- (CGSize)collectionView:(UICollectionView *)collectionView
                  layout:(UIColle         


        
4条回答
  •  庸人自扰
    2021-02-13 22:51

    You can simple override the scroll view delegate

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        collectionView.collectionViewLayout.invalidateLayout()
    }
    

提交回复
热议问题