UINavigationController Push动画

  CATransition *animation = [CATransition animation];

    [animation setDuration:0.5];

    [animation setType:@"cube"];

    [animation setSubtype:kCATransitionFromBottom];

    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];

   CoreImgViewController *imgC = [[[CoreImgViewController alloc] init] autorelease];

    [self.navigationController.view.layer addAnimation:animation forKey:nil];

   [self.navigationController pushViewController:imgC animated:NO];


关于 CATransition

    /* 过渡效果

     fade     //交叉淡化过渡(不支持过渡方向)

     push     //新视图把旧视图推出去

     moveIn   //新视图移到旧视图上面

     reveal   //将旧视图移开,显示下面的新视图

     cube     //立方体翻滚效果

     oglFlip  //上下左右翻转效果

     suckEffect   //收缩效果,如一块布被抽走(不支持过渡方向)

     rippleEffect //滴水效果(不支持过渡方向)

     pageCurl     //向上翻页效果

     pageUnCurl   //向下翻页效果

     cameraIrisHollowOpen  //相机镜头打开效果(不支持过渡方向)

     cameraIrisHollowClose //相机镜头关上效果(不支持过渡方向)

    */

   

    /* 过渡方向

     fromRight;

     fromLeft;

     fromTop;

     fromBottom;

    */


CATransition *animation = [CATransition animation];

animation.delegate = self;

animation.duration = 0.5f//动画时长

animation.timingFunction = UIViewAnimationCurveEaseInOut; //时间选择  速度的调整

animation.fillMode = kCAFillModeForwards;

animation.type = @"cube"//过度效果

animation.subtype = @"formLeft"//过渡方向

animation.startProgress = 0.0 //动画开始起点(在整体动画的百分比)

animation.endProgress = 1.0;  //动画停止终点(在整体动画的百分比)

animation.removedOnCompletion = NO;// 动画完成后是否变回原来的样子 默认为YES

[tabbarController.view.layer addAnimation:animation forKey:@"animation"];




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值