0
目前我有我的didselect擴大我的每一個細胞這樣的選擇上UICollectionView細胞:如何擴大時不會弄亂集合視圖
@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)
}
我遇到的問題是,細胞開始相互重疊而不是向下調整到大單元大小。我希望能夠點擊任何單元格,它會展開爲更大的尺寸,而其他單元格會向下移動以應對此調整大小。點擊第二個單元格會使第一個單元格更小。我如何去做這件事?它是一場鬥爭!
請HALP ....... –