cell的CATransform3D提供了多种动画效果,直接上代码
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section < 5) {
return;
}
<pre name="code" class="objc"> //设置Cell的动画效果为3D效果
动画1:
cell.layer.transform = CATransform3DMakeScale(0.5, 0.5, 1); [UIView animateWithDuration:1 animations:^{ cell.layer.transform = CATransform3DMakeScale(1, 1, 1); }];
动画2:
cell.layer.transform = CATransform3DMakeRotation(1,1, 1, 1);
[UIView animateWithDuration:1 animations:^{
cell.layer.transform = CATransform3DMakeRotation(0,1, 1, 1);
}];
}
CATransform3D提供的动画还有好多,可以去研究下