我正在创建 iPhone 应用程序,其中 onclicking 按钮我将转到另一个带有动画的 View Controller 。下面是我所拥有的。
- (IBAction)booking:(id)sender {
WebDetailsViewController *secondView = [self.storyboard instantiateViewControllerWithIdentifier:@"webDetailsEnglish"];
secondView.fileType = @"web";
secondView.myTitle = @"Booking";
secondView.fileName = @"http://almaktab.com/forms/flight.html";
[UIView beginAnimations: @"Showinfo"context: nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController: secondView animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
当我单击
WebDetailsViewController
上的返回按钮时,我想应用相同的动画效果.知道如何完成这项工作吗?
最佳答案
在 this SO Question 的帮助下下面确实把戏...
-(void) viewWillDisappear:(BOOL)animated {
if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) {
[UIView beginAnimations: @"Showinfo"context: nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
[super viewWillDisappear:animated];
}
谢谢大家的帮助...
关于ios - 单击后退按钮时为 iphone 屏幕设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17144101/