如何在导航弹出控制器时翻转动画,我们如何实现这一点
问问题
161 次
2 回答
0
以下代码用于弹出视图的翻转动画
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:0.375];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
动画块的以下代码
[UIView animateWithDuration:0.75
animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:transition forView:self.navigationController.view cache:NO];
}];
[self.navigationController popViewControllerAnimated:NO];
于 2012-08-28T09:52:22.343 回答
0
试试下面的代码,将您的视图推送到下一个视图。
-(IBAction)gotonextView:(id)sender
{
NextView *info = [[NextView alloc]initWithNibName:@"NextView" bundle:nil];
UINavigationController * nvc = [[UINavigationController alloc] initWithRootViewController:info];
info.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:nvc animated:YES];
}
自动弹出时您将获得相同的翻转动画。
于 2012-08-28T10:00:47.730 回答