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是切换界面所在的界面。
具体参数请参考切换动画效果详细设置
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-11 13:50:21