【发布时间】:2015-08-06 10:23:02
【问题描述】:
我正在创建一个 UICollectionView,但是当一个新单元格被添加到视图中时,它与前一个单元格部分重叠。以下是我的代码:
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CustomCell", forIndexPath: indexPath) as! CustomCell
cell.frame.size.width = self.view.frame.width / 3
cell.frame.size.height = self.view.frame.height / 4
cell.backgroundView = imageView
return cell
}
如何确保单元格不重叠?
【问题讨论】:
标签: ios swift uikit uicollectionview