0
你好我有一個簡單的水平唯一uicollectionview,我想彈出UICollectionViewCell。如何從UICollectionView彈出一個uicollectionViewCell?
當我點擊一個白色的單元格,我得到更大的尺寸,但由集查看仍包含: - >
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// handle tap events
let cell = collectionView.cellForItem(at: indexPath) as! MyCollectionViewCell
print("You selected cell #\(indexPath.item)!")
Fullscreen.originalHeight = (cell.frame.height)
Fullscreen.originalWidth = (cell.frame.width)
Fullscreen.originalX = (cell.frame.origin.x)
Fullscreen.originalY = (cell.frame.origin.y)
print(Fullscreen.originalX,Fullscreen.originalY,Fullscreen.originalWidth,Fullscreen.originalHeight)
cell.superview?.bringSubview(toFront: cell)
cell.clipsToBounds = true
UIView.animate(withDuration: 0.3,
delay: 0,
options: .curveEaseOut,
animations: {
//fullscreen
cell.frame.size.height = (collectionView.superview?.frame.height)!
cell.frame.size.width = (collectionView.superview?.frame.width)!
cell.frame.origin.x = (collectionView.superview?.frame.origin.x)!
cell.frame.origin.y = (collectionView.superview?.frame.origin.y)!
},completion: nil)
正如你所看到的視圖獲取由尺寸切斷Collectionview
我怎樣才能讓它彈出並具有比集合視圖更大的尺寸?
我可以增加collectionView的contentSize.height,但我需要水平線上的白色單元格。
感謝
我剛剛包括我的代碼。我想突出到灰色地帶 – masaldana2