您的位置:首页 > 运维架构

更改pushViewController和popViewController的动画效果

2012-03-30 11:52 831 查看
from:http://hi.baidu.com/sonnywh/blog/item/6d89b68b8c6234649f2fb43c.html

- (void)pushAnimationDidStop {

}

- (void)pushViewController: (UIViewController*)controller

animatedWithTransition: (UIViewAnimationTransition)transition {

[self pushViewController:controller animated:NO];

[UIView beginAnimations:nil context:nil];

[UIView setAnimationDuration:TT_FLIP_TRANSITION_DURATION];

[UIView setAnimationDelegate:self];

[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];

[UIView setAnimationTransition:transition forView:self.view cache:YES];

[UIView commitAnimations];

}

- (UIViewController*)popViewControllerAnimatedWithTransition:(UIViewAnimationTransition)transition {

UIViewController* poppedController = [self popViewControllerAnimated:NO];

[UIView beginAnimations:nil context:NULL];

[UIView setAnimationDuration:TT_FLIP_TRANSITION_DURATION];

[UIView setAnimationDelegate:self];

[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];

[UIView setAnimationTransition:transition forView:self.view cache:NO];

[UIView commitAnimations];

return poppedController;

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