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];
}
- (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];
}
相关文章推荐
- UIImage 图片处理 灰度 反色 深棕色
- iOS UISplitViewController 使用教学
- Mosquitto简要教程
- 开源mqtt代理:mosquitto
- UESTC 760 方方是个坏孩子 有限制的最大连续和
- jms topic与jms queue区别
- UESTC 759 倒推数组
- UITableViewCell的重用机制原理
- UIColor转换成UIImage,UIImage改变尺寸
- 关于ViewGroup中requestDisallowInterceptTouchEvent的用法
- Android 手机上获取物理唯一标识码 IMEI和UUID
- UESTC 758 P酱的冒险旅途
- UIImage简谈:[UIImage imageNamed:]与 [UIImage imageWithContentsOfFile]的区别
- Android子线程中更新UI的三种方法和获取message的两种方法总结
- quicksort算法思想
- UESTC 757 棋盘 博弈、策略
- xcode archived issue:'Cordova/CDVViewController.h' file not found
- 解决UITextField中placeholder和text文本同时显示的问题
- HDOJ 5538 House Building (二维坐标求表面积)
- UITEXTFILD