Keeping the contentOffset in a UICollectionView while rotating Interface Orientation

后端 未结 24 1360
野性不改
野性不改 2020-12-04 07:22

I\'m trying to handle interface orientation changes in a UICollectionViewController. What I\'m trying to achieve is, that I want to have the same contentOffset afte

24条回答
  •  抹茶落季
    2020-12-04 08:16

    You might want to hide the collectionView during it's (incorrect) animation and show a placeholder view of the cell that rotates correctly instead.

    For a simple photo gallery I found a way to do it that looks quite good. See my answer here: How to rotate a UICollectionView similar to the photos app and keep the current view centered?

提交回复
热议问题