TableViewCell的另一种3D效果

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
   
// 从锚点位置出发,逆时针绕 Y Z 坐标轴旋转90
    CATransform3D transform3D = CATransform3DMakeRotation(M_PI_2, 0.0, 1.0, 1.0);
    // 定义 cell 的初始状态
    cell.
alpha = 0.0;
    cell.
layer.transform = transform3D;
    cell.layer.anchorPoint = CGPointMake(0.0, 0.5); // 设置锚点位置;默认为中心点(0.5, 0.5)
    // 定义 cell 的最终状态,执行动画效果
    [UIView animateWithDuration:0.5 animations:^{
        cell.
alpha = 1.0;
        cell.
layer.transform = CATransform3DIdentity;
       
CGRect rect = cell.frame;
        rect.
origin.x = 0.0;
        cell.
frame = rect;
    }];
}
posted @ 2016-01-22 11:48  挽月细数风流  阅读(252)  评论(0编辑  收藏  举报