iOS 10/11 UICollectionViewFlowLayout using UICollectionViewFlowLayoutAutomaticSize results in footer supplementary view misaligned

后端 未结 2 845
滥情空心
滥情空心 2021-01-31 10:23

So this is an interesting issue we found with UICollectionViewFlowLayout on iOS 10 (still an issue on 11) and using UICollectionViewFlowLayoutAutomaticSize

2条回答
  •  迷失自我
    2021-01-31 10:54

    I came across the same problem. UICollectionViewFlowLayoutAutomaticSize doesn't work for supplementary views. Use the UICollectionViewDelegateFlowLayout to give the size explicitly. Its better to calculate the sizes and use delegates as automatic size calculations causes lagging, at times.

    use referenceSizeForHeaderInSection and referenceSizeForFooterInSection delegate methods to give the header and footer size explicitly.

提交回复
热议问题