UICollectionReusableView method not being called

后端 未结 11 720
暗喜
暗喜 2021-01-31 13:13

I want my sections in the UICollectionView to have a header with an image.

I have followed these steps:

  • at the storyboard, assigned a header a
11条回答
  •  遥遥无期
    2021-01-31 13:42

    Swift 3.0 (xcode 8.2.1)

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
        return CGSize(width:collectionView.frame.size.width, height:30.0)
    }
    

提交回复
热议问题