【发布时间】:2016-04-10 21:15:43
【问题描述】:
当单元格被选中时,我正在尝试更改UICollectionView 中单元格的高度。
我设法改变了高度,但是,当我选择一个单元格时,其他单元格的 y 位置不会改变,导致所选单元格与其他单元格重叠。
a 单元格高度被修改后,如何告诉其他单元格改变 y 位置?
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
if let detailsCell = collectionView.cellForItemAtIndexPath(indexPath) as? UserDetailsCell {
UIView.animateWithDuration(0.5, delay: 0, options: .TransitionCurlUp, animations: {
detailsCell.frame.size.height = 300
}, completion: nil)
}
print(indexPath.row)
}
【问题讨论】:
标签: ios swift uicollectionview uicollectionviewcell