Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to zoom in the content of cell in uicollectionview

enter image description here

In the above image,A,B,C,D,E are each custom cell,of collection view and i want to zoom in the cell one by one like c cell.

Any suggestion?

like image 941
Parvesh Singh Avatar asked Oct 17 '22 21:10

Parvesh Singh


1 Answers

Just call this method when your collectionviewcell click

[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){
    }];
}
like image 152
Himanshu Moradiya Avatar answered Nov 01 '22 17:11

Himanshu Moradiya