回答

1

只需調用此方法時,您collectionviewcell基於人士Himanshu Moradiya解決方案點擊

[self animateZoomforCell:cell]; // pass cell as collectionviewcell 

-(void)animateZoomforCell:(UICollectionViewCell*)zoomCell 
{ 
    [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 

     zoomCell.transform = CGAffineTransformMakeScale(1.6,1.6); 
    } completion:^(BOOL finished){ 
    }]; 
} 
-(void)animateZoomforCellremove:(UICollectionViewCell*)zoomCell 
{ 
    [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 

     zoomCell.transform = CGAffineTransformMakeScale(1.0,1.0); 
    } completion:^(BOOL finished){ 
    }]; 
} 
+0

非常感謝兄弟!你解決了我的問題! –

+0

@ParveshSingh有你的問題解決,然後批准我的答案,並給予投票,讓其他用戶也可以找到解決方案。謝謝。快樂編碼 –

+0

肯定himanshu ....快樂編碼。 –

1

SWIFT 3

func animateZoomforCell(zoomCell : UICollectionViewCell) 
{ 
    UIView.animate(
     withDuration: 0.2, 
     delay: 0, 
     options: UIViewAnimationOptions.curveEaseOut, 
     animations: { 
         zoomCell.transform = CGAffineTransform.init(scaleX: 1.2, y: 1.2) 
      }, 
    completion: nil) 
} 
func animateZoomforCellremove(zoomCell : UICollectionViewCell) 
{ 
    UIView.animate(
     withDuration: 0.2, 
     delay: 0, 
     options: UIViewAnimationOptions.curveEaseOut, 
     animations: { 
      zoomCell.transform = CGAffineTransform.init(scaleX: 1.0, y: 1.0) 
    }, 
     completion: nil) 

} 
相關問題