UICollectionView Floating Headers on Top and Side

后端 未结 2 1506
别跟我提以往
别跟我提以往 2021-02-06 11:42

How do you implement headers in a UICollectionView? I know you can put in supplementary views, but I don\'t know how to make them \"float\" above a section like hea

2条回答
  •  醉梦人生
    2021-02-06 12:08

    Update for iOS9:

    let flow = collectionView.collectionViewLayout as! UICollectionViewFlowLayout
    flow.sectionHeadersPinToVisibleBounds = true
    

    Pass it along.

提交回复
热议问题