1

Im working on an iOS app in Swift, using a UICollectionView. I’m autosizing collection view cells:

if let cvl = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
    cvl.estimatedItemSize = CGSize(width: 240, height: 70)
}

It is working fine, every cell is autosized perfectly. But I have an issue when I rotated the device.

If first cell is not visible and device is rotated, then scrolling to top in order to make first cell visible -> all cells are autosized correctly, but first cell is overlapped. Not getting any warning or message on Debug Area.

First cell overlapped

If first cell is visible and device is rotated -> all cells are autosized correctly, first cell not is overlapped.

First cell non overlapped

Does anyone have any idea what is going on?

fbernaly
  • 61
  • 1
  • 9
  • set dynamic size refer link: http://stackoverflow.com/questions/23760275/dynamic-size-uicollectionview-cell – Lokesh Dudhat Oct 22 '15 at 18:56
  • I think that is the old way before iOS8. I'm using [Autosizing Collection View Cells](https://goo.gl/lp18tZ) , this feature was introduced with iOS8. – fbernaly Oct 22 '15 at 19:08

0 Answers0