iOS控制器跳转动画

1
2
3
4
5
6
7
8
9
10
11
12
13
14
MyViewController *myVC = [[MyViewController alloc]init];
 //创建动画
 CATransition *animation = [CATransition animation];
 //设置运动轨迹的速度
 animation.timingFunction = UIViewAnimationCurveEaseInOut;
 //设置动画类型为立方体动画
 animation.type = @"cube";
 //设置动画时长
 animation.duration =0.5f;
 //设置运动的方向
 animation.subtype =kCATransitionFromRight;
 //控制器间跳转动画
 [[UIApplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];
[self presentViewController:myVC animated:NO completion:nil];

  下面附上一些常用的动画类型:

  Fade = 1,                   //淡入淡出
    Push,                       //推挤
    Reveal,                     //揭开
    MoveIn,                     //覆盖
    Cube,                       //立方体
    SuckEffect,                 //吮吸
    OglFlip,                    //翻转
    RippleEffect,               //波纹
    PageCurl,                   //翻页
    PageUnCurl,                 //反翻页
    CameraIrisHollowOpen,       //开镜头
    CameraIrisHollowClose,      //关镜头
    CurlDown,                   //下翻页
    CurlUp,                     //上翻页
    FlipFromLeft,               //左翻转
 
      附上简书大神的文章:http://www.jianshu.com/p/09b7e5ff371c
    FlipFromRight,              //右翻转
posted @ 2017-05-08 15:34  徐家汇  阅读(575)  评论(0编辑  收藏  举报