首页 > 其他 > 详细

简单tableView的cell的动画旋转

时间:2015-10-25 14:59:56      阅读:225      评论:0      收藏:0      [点我收藏+]

cell 的动画一般用的不多,但是简单的修改一下属性还是能把cell的出场华丽的转世一下,在代理方法willDisplayCell中设置一下layer的属性就OK了。

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    //设置anchorPoint
    cell.layer.anchorPoint = CGPointMake(0, 0.5);
    //为了防止cell视图移动,重新把cell放回原来的位置
    cell.layer.position = CGPointMake(0, cell.layer.position.y);
    
    //设置cell 按照z轴旋转90度,注意是弧度
    cell.layer.transform = CATransform3DMakeRotation(M_PI_2, 0, 0, 1.0);
    cell.alpha = 0.0;
    
    [UIView animateWithDuration:1 animations:^{
        cell.layer.transform = CATransform3DIdentity;
        cell.alpha = 1.0;
    } completion:^(BOOL finished) {
        
    }];
}

简单tableView的cell的动画旋转

原文:http://www.cnblogs.com/Lvfengxian/p/4908717.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!