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

관련 문제