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