Dynamically setting layout on UICollectionView causes inexplicable contentOffset change

前端 未结 10 1554
一生所求
一生所求 2020-11-29 16:10

According to Apple\'s documentation (and touted at WWDC 2012), it is possible to set the layout on UICollectionView dynamically and even animate the changes:

10条回答
  •  有刺的猬
    2020-11-29 16:42

    UICollectionViewLayout contains the overridable method targetContentOffsetForProposedContentOffset: which allows you to provide the proper content offset during a change of layout, and this will animate correctly. This is available in iOS 7.0 and above

提交回复
热议问题