【发布时间】:2017-03-14 12:48:07
【问题描述】:
我正在尝试创建一个自定义单元格,每个单元格都有上、左、下间距。是否有任何集合视图数据源方法,以便在每个索引路径中指定单元格插图。
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: block.blockCellIdentifier, for: indexPath) as! BlockBaseClass
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
layout.minimumLineSpacing = 10
return cell
}
但布局不起作用,在 cellforitemAt 索引路径内。
【问题讨论】:
标签: ios swift uicollectionview uicollectionviewlayout