UICollectionReusableView method not being called

后端 未结 11 873
暗喜
暗喜 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:49

    Swift 4 Xcode 9.1 Beta 2

    Add @objc

    @objc func collectionView(_ collectionView: UICollectionView, layout  collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize{
        let size = CGSize(width: 400, height: 50)
        return size
    }
    

    Credits: https://medium.com/@zonble/your-delegation-methods-might-not-be-called-in-swift-3-c6065ed7b4cd

提交回复
热议问题