UICollectionView and Supplementary View (header)

前端 未结 10 1129
南旧
南旧 2021-02-04 05:17

Trying to add a a Supplementary view into my UICollectionView as a header. I\'m having issues getting it to work.

I use a custom UICollectionViewFlowL

10条回答
  •  旧巷少年郎
    2021-02-04 05:25

    If you look at the error message, it says that the data source is not set. This should fix it:

    self.collectionView.dataSource = self;

    Make sure your view controller implements the data source protocol:

    YourViewController : UIViewController

提交回复
热议问题