美文网首页
iOS中给tableview的cell添加3D动画

iOS中给tableview的cell添加3D动画

作者: 咋了爸爸 | 来源:发表于2016-11-08 16:00 被阅读240次

直接上代码


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

{
    
    //设置Cell的动画效果为3D效果
    
    //设置x和y的初始值为0.1;
    
cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
    
    //x和y的最终值为1
    
    [UIView animateWithDuration:1 animations:^{
        
        cell.layer.transform = CATransform3DMakeScale(1, 1, 1);
        
    }];
    
}

相关文章

网友评论

      本文标题:iOS中给tableview的cell添加3D动画

      本文链接:https://www.haomeiwen.com/subject/jbgauttx.html