只是为了备忘,关于tableView的还没做过测试,不过代码很简单,看上去可行的样子
UITableView sectionHead取消悬浮
原地址:http://www.tuicool.com/articles/niuQZjm
UICollectionView sectionHead悬浮,第一种方法是重载collectionFlowLayout,git上有个现成的(确定可行)
地址如下:https://github.com/HebeTienCoder/XLPlainFlowLayout
另一种方法只使用于IOS9:(没验证过)
let layout = UICollectionViewFlowLayout()
layout.sectionHeadersPinToVisibleBounds = true
layout.minimumInteritemSpacing = 1
layout.minimumLineSpacing = 1
super.init(collectionViewLayout: layout)
stack overflow上也有很详细的讨论,地址如下: