TableViewCell加动画
2016-02-17 15:41
302 查看
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
//1.
配置CATransform3D的内容
CATransform3D transform;
transform = CATransform3DMakeTranslation(50, 100, 0);
// transform.m34 = 1.0/ -600;
//2.
定义cell的初始状态
cell.layer.shadowColor = [[UIColor blackColor]CGColor];
cell.layer.shadowOffset = CGSizeMake(10, 10);
cell.alpha = 0;
cell.layer.transform = transform;
cell.layer.anchorPoint = CGPointMake(0.5, 0.5);
//3.
定义cell的最终状态,并提交动画
[UIView beginAnimations:@"transform" context:NULL];
[UIView setAnimationDuration:0.5];
cell.layer.transform = CATransform3DIdentity;
cell.alpha = 1;
cell.layer.shadowOffset = CGSizeMake(0, 0);
cell.frame = CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
[UIView commitAnimations];
}
//1.
配置CATransform3D的内容
CATransform3D transform;
transform = CATransform3DMakeTranslation(50, 100, 0);
// transform.m34 = 1.0/ -600;
//2.
定义cell的初始状态
cell.layer.shadowColor = [[UIColor blackColor]CGColor];
cell.layer.shadowOffset = CGSizeMake(10, 10);
cell.alpha = 0;
cell.layer.transform = transform;
cell.layer.anchorPoint = CGPointMake(0.5, 0.5);
//3.
定义cell的最终状态,并提交动画
[UIView beginAnimations:@"transform" context:NULL];
[UIView setAnimationDuration:0.5];
cell.layer.transform = CATransform3DIdentity;
cell.alpha = 1;
cell.layer.shadowOffset = CGSizeMake(0, 0);
cell.frame = CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
[UIView commitAnimations];
}
相关文章推荐
- archive的时候报“ no identity found"错,怎么办?
- power designer导出word或html
- 彻底解决Spring MVC 中文乱码 问题
- 深入分析MySQL ERROR 1045 (28000)
- Nancy之Forms authentication的简单使用
- 在MainActivity的内部静态类PlaceholderFragment 类中的onCreateView中获取fragment_main.xml中控件
- 计算进位次数
- gerrit添加新用户
- log4j.properties配置详解
- Error: "源代码不可用于此位置"
- 使用jquery获取同组单选框中被选中项的value或给同组单选框赋值
- blog
- 格式化数字
- 【笔记】DOM探索基础篇(二)
- 算法导论值快速排序
- Hibernate反向工程-——Myeclipse从数据库反向生成Java类
- JAVA字符串格式化-String.format()的使用
- CodeSign error: no provisioning profile at path '/Users/user/Library/MobileDevice/Provisioning Profi
- android 屏幕适配之dp
- Openfire 自定义Servlet插件访问Url登录拦截问题(源码方式)