【发布时间】:2016-01-27 17:02:59
【问题描述】:
我想在我的标题和实际项目之间添加一些间距,目前看起来像这样:
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
// Create header
switch kind{
case UICollectionElementKindSectionHeader:
let headerView = iconCollectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "customIconHeaderView", forIndexPath: indexPath) as! CustonIconHeaderView
headerView.setUp() //add whatever into the view
return headerView
default:
assert(false, "Unexpected element kind")
}
}
【问题讨论】:
-
您可以添加一个间隔单元格作为该部分的第一个单元格。我知道这不是一个理想的实现,但万无一失
标签: ios swift uicollectionview