UITableViewCell显示动画

来源:互联网 发布:iphone软件怎么做 编辑:程序博客网 时间:2024/03/29 22:51

CATransform3D rotation;//3D旋转

        

        rotation = CATransform3DMakeTranslation(0 ,50 ,20);

//        rotation = CATransform3DMakeRotation( M_PI_4 , 0.0, 0.7, 0.4);

        

        //逆时针旋转

        rotation = CATransform3DScale(rotation, 0.9, .9, 1);

        

        rotation.m34 = 1.0/ -600;

        

        cell.layer.shadowColor = [[UIColor blackColor]CGColor];

        cell.layer.shadowOffset = CGSizeMake(10, 10);

        cell.alpha = 0;

        

        cell.layer.transform = rotation;

        

        [UIView beginAnimations:@"rotation" context:NULL];

        //旋转时间

        [UIView setAnimationDuration:0.6];

        cell.layer.transform = CATransform3DIdentity;

        cell.alpha = 1;

        cell.layer.shadowOffset = CGSizeMake(0, 0);

        [UIView commitAnimations];



//由小到大渐变

CATransform3D transform = CATransform3DIdentity;
    transform = CATransform3DRotate(transform, 0, 0, 0, 1);//渐变
    transform = CATransform3DTranslate(transform, -200, 0, 0);//左边水平移动
    transform = CATransform3DScale(transform, 0, 0, 0);//由小变大
    
    cell.layer.transform = transform;
    cell.layer.opacity = 0.0;
    
    [UIView animateWithDuration:0.6 animations:^{
        cell.layer.transform = CATransform3DIdentity;
        cell.layer.opacity = 1;
    }];


0 0
原创粉丝点击