MyViewController *myVC = [[MyViewController alloc]init];
//創(chuàng)建動(dòng)畫
CATransition *animation = [CATransition animation];
//設(shè)置運(yùn)動(dòng)軌跡的速度
animation.timingFunction = UIViewAnimationCurveEaseInOut;
//設(shè)置動(dòng)畫類型為立方體動(dòng)畫
animation.type = @"cube";
//設(shè)置動(dòng)畫時(shí)長(zhǎng)
animation.duration =0.5f;
//設(shè)置運(yùn)動(dòng)的方向
animation.subtype =kCATransitionFromRight;
//控制器間跳轉(zhuǎn)動(dòng)畫
[[UIapplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];
[self PResentViewController:myVC animated:NO completion:nil];
下面附上一些常用的動(dòng)畫類型:
Fade = 1, //淡入淡出
Push, //推擠
Reveal, //揭開
MoveIn, //覆蓋
Cube, //立方體
SuckEffect, //吮吸
OglFlip, //翻轉(zhuǎn)
RippleEffect, //波紋
PageCurl, //翻頁
PageUnCurl, //反翻頁
CameraIrisHollowOpen, //開鏡頭
CameraIrisHollowClose, //關(guān)鏡頭
CurlDown, //下翻頁
CurlUp, //上翻頁
FlipFromLeft, //左翻轉(zhuǎn)
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注