您的位置:首页 > 其它

两个ViewController之间跳转的动画效果

2013-02-19 10:49 375 查看
两个ViewController之间跳转的动画效果

进入SecondeViewController:

SecondViewCotroller *secondViewController = [[SecondViewCotrolleralloc]
init];

[UIViewbeginAnimations:nilcontext:NULL];

[UIViewsetAnimationCurve:UIViewAnimationCurveEaseOut];

[UIViewsetAnimationDuration:1.0f];

[self.navigationControllerpushViewController:secondViewController
animated:YES];

[UIViewcommitAnimations];

返回到FirstViewController:

CATransition *animation = [CATransitionanimation];
animation.duration =
1.0f;

//slow at beginning and end

animation.timingFunction =
UIViewAnimationCurveEaseInOut;
animation.type =
@"cube";

//从右向左

[animation setSubtype:kCATransitionFromRight];

[self.navigationController.view.layeraddAnimation:animation
forKey:@"animation"];

[self.navigationControllerpopViewControllerAnimated:YES];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: