Pragma CATransition动画实现
CATransition *animation = [CATransition animation]; animation.duration = DURATION; //设置运动时间 animation.type = type; //设置运动type animation.subtype = subtype; //设置子类 animation.timingFunction = timingFunction; //设置运动速度 [view.layer addAnimation:animation forKey:@"animation"];
type效果列表
- Fade //淡入淡出
- Push //推挤
- Reveal //揭开
- MoveIn //覆盖
- Cube //立方体
- SuckEffect //吮吸
- OglFlip //翻转
- RippleEffect //波纹
- PageCurl //翻页
- PageUnCurl //反翻页
- CameraIrisHollowOpen //开镜头
- CameraIrisHollowClose //关镜头
- CurlDown //下翻页
- CurlUp //上翻页
- FlipFromLeft //左翻转
- FlipFromRight //右翻转
subtype效果列表
- kCATransitionFromLeft
- kCATransitionFromBottom
- kCATransitionFromRight
- kCATransitionFromTop
timingFunction效果列表
- kCAMediaTimingFunctionLinear 线性,即匀速
- kCAMediaTimingFunctionEaseIn 先慢后快
- kCAMediaTimingFunctionEaseOut 先快后慢
- kCAMediaTimingFunctionEaseInEaseOut 先慢后快再慢
- kCAMediaTimingFunctionDefault 实际效果是动画中间比较快.