Par*_*ngh 5 objective-c ios uicollectionview uicollectionviewcell uicollectionviewlayout
在上图中,A、B、C、D、E 是集合视图的每个自定义单元格,我想像 c 单元格一样一一放大单元格。
有什么建议吗?
只需在您的 CollectionViewCell 单击时调用此方法即可
[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){
}];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2612 次 |
| 最近记录: |