关键属性:
- type 过渡效果
- kCATransitionFade 淡出
- kCATransitionMoveIn 覆盖原图
- kCATransitionPush 推出
- kCATransitionReveal 底部显出来
- subtype 过渡方向
- kCATransitionFromRight;
- kCATransitionFromLeft 默认值
- kCATransitionFromTop;
- kCATransitionFromBottom
代码演示1:不用setSubtype,只用setType
1 animation.type=@"pageCurl";
- pageCurl 向上翻一页
- pageUnCurl 向下翻一页
- rippleEffect 滴水效果
- suckEffect 收缩效果,如一块布被抽走
- cube 立方体效果
- oglFlip 上下翻转效果
代码演示2:setType与setSubtype组合
1 CATransition *animation = [CATransition animation]; 2 3 animation.delegate = self; 4 5 animation.duration = 1.0f; 6 7 animation.timingFunction = UIViewAnimationCurveEaseInOut; 8 9 animation.type = kCATransitionMoveIn; 10 11 animation.subtype = kCATransitionFromTop; 12 13 [_myView.layer addAnimation:animation forKey:@"myTransition"];