ViewController push的自定义动画

    CATransition *transition = [CATransition animation];
    transition.duration = 1.0f;
    transition.subtype = kCATransitionFromTop;//可更改为其他方式
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = @"pageUnCurl";//可更改为其他方式
    [self.navigationController.view.layer addAnimation:transition forKey:nil];
    
    [self.navigationController popViewControllerAnimated:NO];

 其中 type包括:

kCATransitionFade
kCATransitionMoveIn
kCATransitionPush
kCATransitionReveal
@"cameraIris"//相机
@"cameraIrisHollowOpen"//相机开
@"cameraIrisHollowClose"//相机关
@"cube"//魔方
@"alignedCube"//..
@"flip"//页面翻转
@"alignedFlip"//..
@"oglFlip"//..
@"rotate"//风车
@"pageCurl"//黄历翻页
@"pageUnCurl"//..
@"rippleEffect"//波纹
@"suckEffect"//吸收
@"spewEffect"//淡入淡出
@"genieEffect"//..
@"unGenieEffect"//..
@"twist"//..
@"tubey"//..
@"swirl"//..
@"charminUltra"//..
@"zoomyIn"//..
@"zoomyOut"//..

 

 subtype包括:

kCATransitionFromRight
kCATransitionFromLeft
kCATransitionFromTop
kCATransitionFromBottom

 

 
 
posted @ 2015-07-28 16:17  lxl奋小斗  阅读(269)  评论(0编辑  收藏  举报