【发布时间】:2017-06-01 01:26:51
【问题描述】:
目前我有一个我的 didselect 来扩展我的每个单元格,如下所示:
@objc(collectionView:didSelectItemAtIndexPath:) func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
print("selected")
let cell = collectionView.cellForItem(at: indexPath)
UIView.animate(withDuration: 0.5, animations: ({
cell?.frame = CGRect(x: 0, y: 0, width: 331, height: 320)
// cell?.superview?.bringSubview(toFront: cell!)
}), completion: nil)
}
我遇到的问题是单元格开始相互重叠,而不是向下调整到较大的单元格大小。我希望能够单击任何单元格,它会扩大到更大的尺寸,而其他单元格会向下移动以适应这种调整大小。单击第二个单元格会使第一个单元格变小。我该怎么做呢?这是一场斗争!
【问题讨论】:
-
请停下来......
标签: ios swift uicollectionview cell