0

こんにちは私は単純な水平のuicollectionviewしか持っていないので、UICollectionViewCellをポップアウトしたいと思います。UICollectionViewからuicollectionViewCellをポップする方法は?

enter image description here

私は白のセルをクリックすると、私は大きな寸法を取得しますが、それでもコレクションビューに含まれている: - あなたは、ビューがディメンションによって切断されます見ることができるように> enter image description here

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を大きくすることができますが、私は水平線で白いセルが必要です。私はあなたが実装しようとしているかを確認できるように、あなたが実際に達成したいかについて

答えて

1

ありません非常に明確

おかげで、多分あなたはあなたのコードの一部を共有することができます。

ちょうどあなたの言葉によると、セルをポップアップするときに言ったようにcontentSize.heightを増やしてみて、白いものに戻る前にcontentSize.heightをサイズに戻すことができます。

+0

私は自分のコードを追加しました。私は灰色の領域に飛び出したかった – masaldana2

関連する問題