给TableViewCell添加动画
来源:互联网 发布:php eval返回值 编辑:程序博客网 时间:2024/04/29 12:25
实现TableView得到代理方法
- (void)tableView:(UITableView )tableView willDisplayCell:(UITableViewCell )cell forRowAtIndexPath:(NSIndexPath *)indexPath;
在代理方法中实现实现如下代码:
CATransform3D trainsform; trainsform = CATransform3DMakeTranslation(0, 100, 0); cell.alpha = 0; cell.layer.transform = trainsform; [UIView animateWithDuration:2 animations:^{ cell.alpha = 1; cell.layer.transform = CATransform3DIdentity; }];
实现效果是从下至上平移.
3d立体效果(不完善有BUG)
CATransform3D rotation; rotation = CATransform3DMakeRotation( (90.0*M_PI)/180, 0.0, 0.7, 0.4); rotation.m34 = 1.0/ -600; cell.layer.shadowColor = [[UIColor blackColor]CGColor]; cell.layer.shadowOffset = CGSizeMake(10, 10); cell.alpha = 0; cell.layer.transform = rotation; cell.layer.anchorPoint = CGPointMake(0, 0.5); [UIView beginAnimations:@"rotation" context:NULL]; [UIView setAnimationDuration:0.8]; cell.layer.transform = CATransform3DIdentity; cell.alpha = 1; cell.layer.shadowOffset = CGSizeMake(0, 0); [UIView commitAnimations];
相关连接参考:http://www.cocoachina.com/bbs/read.php?tid=203678
0 0
- 给TableViewCell添加动画
- iOS 给tableViewCell添加动画
- 给cell添加动画
- 如何给tableviewcell加3D旋转动画
- 给不同的TableViewCell 添加不同的Image
- 给控件添加动画效果
- 给TableView Cell 添加动画
- 给ViewPager添加切换动画
- 给view添加过场动画
- 给ListView添加动画效果
- 给view添加旋转动画
- 给tableview cell添加动画
- Unity动画系统-给人物添加动画
- TableViewCell加动画
- TableViewCell添加和删除
- Qt-----给Qt程序添加启动动画
- 给Qt程序添加启动动画
- Qt-----给Qt程序添加启动动画
- 排序算法的学习
- c++实现顺序表的操作
- autocreatemr
- 最短路径问题
- web前端细节性问题(面试时可能遇到的问题)——div+css(2)
- 给TableViewCell添加动画
- Toy Program:线程 alive
- android图像处理(二)
- android测试有多重要!
- 常见的加密算法
- 我的Android进阶之旅------>RxJava学习资料汇总
- APP开发实战29-HTTP头字段介绍
- coolbusync
- sproxy代理生成代码