转场动画 CATransition 转场动画 可以切换视图 视图控制器
type 转场动画的 动画效果
subtype 转场动画 效果的方向
kCATransitionFade 交叉淡化过渡
kCATransitionMoveIn 新视图移到旧视图上面
kCATransitionPush 新视图把旧视图推出去
kCATransitionReveal 将旧视图移开,显示下面的新视图
私有api 不建议使用 苹果不提供维护 并且有可能app审核不通过
pageCurl 向上翻一页
pageUnCurl 向下翻一页
rippleEffect 滴水效果
suckEffect 收缩效果 如一块布被抽走
cube 立方体效果
oglFlip 上下翻转效果
初始化:
//初始化一个页面
Next_ViewController *nextVC = [[Next_ViewController alloc]init];
//初始化转场动画:
CATransition *animation = [CATransition animation];
animation.type = @"suckEffect";
animation.subtype = kCATransitionFromLeft;
animation.duration= 1.0;
// 添加转场动画
[self.navigationController.view.layer addAnimation:animation forKey:nil];
//跳转页面
[self.navigationController pushViewController:nextVC animated:NO];