1

I'm trying to use the headerReferenceSize in my custom UICollectionViewFlowLayout.

I have set the collectionView:layout:referenceSizeForHeaderInSection: method in the collectionView delegate:

func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
    return CGSize(width: UIScreen.mainScreen().bounds.width, height: round(250*(UIScreen.mainScreen().bounds.width/414)))
}

This gets called once when the view loads. However, the custom UICollectionViewFlowLayout keeps retrieving the size set in the storyboard, and not from my delegate. Why is this?

Hasya
  • 9,792
  • 4
  • 31
  • 46
Tometoyou
  • 7,792
  • 12
  • 62
  • 108

0 Answers0