how to reload supplementary view in collectionView

前端 未结 2 727
夕颜
夕颜 2020-12-14 16:14

Is there an easy way to reload the suppplementary view only in a UICollectionViewFlowLayout? I don\'t want to reload the whole thing. Is it possible to do so?

2条回答
  •  忘掉有多难
    2020-12-14 16:28

    If you want to change the layout or size of the supplementary view from the Controller, use[self.collectionView.collectionViewLayout invalidateLayout].If you want to refresh the supplementary view only,use [supplementaryView setNeedsDisplay].Use both if the supplementary view is complex and/or will change its dimensions.

提交回复
热议问题