layoutAttributesForSupplementaryViewOfKind not called

前端 未结 1 775
[愿得一人]
[愿得一人] 2021-02-20 17:06

I am writing a custom flow layout for a UICollectionView. I can see and scroll the cells.

The problem is that I can\'t make the supplementary view for the section header

相关标签:
1条回答
  • 2021-02-20 17:54

    You need to implement layoutAttributesForElementsInRect: to return an attributes instance for each supplementary view (in addition to each cell):

    Subclasses must override this method and use it to return layout information for all items whose view intersects the specified rectangle. Your implementation should return attributes for all visual elements, including cells, supplementary views, and decoration views.

    0 讨论(0)
提交回复
热议问题