视图控制器转场动画——CATransition
来源:互联网 发布:验血公司theranos知乎 编辑:程序博客网 时间:2024/06/06 05:07
github:https://github.com/potato512/SYAnimation
使用CATransition进行视图控制器的转场动画自定义。
效果图:
代码示例:
// 转场动画 CATransition *animation = [CATransition animation]; animation.duration = 0.6; animation.fillMode = kCAFillModeForwards; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; // 转场效果-动画类型type 动画方向subtype if (0 == indexPath.row) { animation.type = @"cube"; animation.subtype = kCATransitionFromLeft; } else if (1 == indexPath.row) { animation.type = @"moveIn"; animation.subtype = kCATransitionFromLeft; } else if (2 == indexPath.row) { animation.type = @"reveal"; animation.subtype = kCATransitionFromLeft; } else if (3 == indexPath.row) { animation.type = @"fade"; animation.subtype = kCATransitionFromLeft; } else if (4 == indexPath.row) { animation.type = @"pageCurl"; animation.subtype = kCATransitionFromLeft; } else if (5 == indexPath.row) { animation.type = @"pageUnCurl"; animation.subtype = kCATransitionFromRight; } else if (6 == indexPath.row) { animation.type = @"suckEffect"; animation.subtype = kCATransitionFromLeft; } else if (7 == indexPath.row) { animation.type = @"rippleEffect"; animation.subtype = kCATransitionFromLeft; } else if (8 == indexPath.row) { animation.type = @"oglFlip"; animation.subtype = kCATransitionFromLeft; } else if (9 == indexPath.row) { animation.type = @"rotate"; animation.subtype = @"90cw"; } else if (10 == indexPath.row) { animation.type = @"push"; animation.subtype = kCATransitionFromLeft; } else if (11 == indexPath.row) { animation.type = @"cameraIrisHollowOpen"; animation.subtype = kCATransitionFromLeft; } else if (12 == indexPath.row) { animation.type = @"cameraIrisHollowClose"; animation.subtype = kCATransitionFromLeft; } else if (13 == indexPath.row) { animation.type = @"kCATransitionFade"; animation.subtype = kCATransitionFromLeft; } else if (14 == indexPath.row) { animation.type = @"kCATransitionMoveIn"; animation.subtype = kCATransitionFromLeft; } else if (15 == indexPath.row) { animation.type = @"kCATransitionPush"; animation.subtype = kCATransitionFromLeft; } else if (16 == indexPath.row) { animation.type = @"kCATransitionReveal"; animation.subtype = kCATransitionFromLeft; } // 添加转场动画到导航视图控制上 [self.navigationController.view.layer addAnimation:animation forKey:nil];
阅读全文
0 0
- 视图控制器转场动画——CATransition
- CATransition—转场动画
- 转场动画—— CATransition
- iOS——转场动画(CATransition)
- CATransition转场动画
- CATransition 转场动画
- CATransition 转场动画
- CATransition转场动画
- CATransition转场动画
- 转场动画CATransition
- CATransition-转场动画
- CATransition-转场动画
- CATransition转场动画
- 转场动画CATransition
- CATransition(转场动画)
- iOS转场动画CATransition
- CoreAnimation---CATransition 转场动画
- CATransition-转场动画
- [YTU]_2440( C++习题 复数类--重载运算符+,-,*,/)
- C++ STL中map按照vaule来排序
- Swift 可选值
- socket输出的小问题
- W25Q256学习
- 视图控制器转场动画——CATransition
- 《凸优化理论》-----共轭函数
- [scope.strip() for scope in flags.split(',')]
- ROS节点,消息,话题,服务的介绍
- Android 关于SP读取与存储正确打开方式?
- Oracle中的 NVL,NVL2,NULLIF,COALESCE 函数
- 面试题21:栈:包含min函数的栈
- 神经网络纹理合成和损失函数风格转移
- RTMP header解析