Xcode界面切换动画效果

CATransition *animation = [CATransition animation];

[animation setDuration:0.2f];

[animation setTimingFunction:[CAMediaTimingFunction

functionWithName:kCAMediaTimingFunctionEaseIn]];

[animation setType:kCATransitionPush];

if (isLeft) {

[animation setSubtype: kCATransitionFromLeft];

} else {

[animation setSubtype: kCATransitionFromRight];

}

[bottomView.layer addAnimation:animation forKey:@"Reveal"];


直接把这段代码复制到须要界面切换的位置就能够了。

bottomView是切换界面所在的界面。

具体參数请參考切换动画效果具体设置


posted @ 2016-04-14 15:40  blfshiye  阅读(374)  评论(0编辑  收藏  举报