您的位置:首页 > 产品设计 > UI/UE

UITableView的3D效果

2015-11-02 15:06 344 查看
tableView正常创建,用下面这个方法就行实现,很简单。

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

//
参数1:旋转角度

//
参数2:X轴

//
参数3:Y轴

//
参数4:Z轴

CATransform3D rotation =
CATransform3DMakeRotation(90 *
M_PI / 180,
1, 1, 1);

[[cell layer]
setTransform:rotation];

//
动画开始

[UIView
beginAnimations:nil
context:nil];

//
动画时长

[UIView
setAnimationDuration:1];

[[cell layer]
setTransform:CATransform3DIdentity];

//
动画结束

[UIView
commitAnimations];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: