TabkeViewCell滚动时候的动画

来源:互联网 发布:阿里云小图标 编辑:程序博客网 时间:2024/06/08 11:41

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

{

    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;

    [UIViewanimateWithDuration:0.6 animations:^{

        cell.layer.transform =CATransform3DIdentity;

        cell.layer.opacity = 1;

    }];

}


0 0