实现cell旋转加缩放

、、、
-(void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {

/*  从锚点位置出发,逆时针绕 X 坐标轴旋转90度*/
CATransform3D transform3D = CATransform3DMakeRotation(M_PI_2, 1.0, 0.0, 0.0);
// 缩放 x 轴缩放 0.2
CATransform3D transform3D1 = CATransform3DScale(transform3D, 0.2, 1, 1);
//     定义 cell 的初始状态
cell.alpha = 0.0;
cell.layer.transform = transform3D1;
cell.layer.anchorPoint = CGPointMake(0.5, 0.5); // 设置锚点位置;默认为中心点(0.5, 0.5)

[UIView animateWithDuration:0.5 animations:^{
    cell.alpha = 1.0;
    cell.layer.transform = CATransform3DIdentity;
}];

}
、、、

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容