2

我正在创建 iPhone 应用程序,其中 onclicking 按钮我将转到另一个带有动画的视图控制器。下面是我所拥有的。

- (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

知道如何完成这项工作吗?

4

1 回答 1

0

在下面这个 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];
}

谢谢大家的帮助...

于 2013-08-13T19:42:37.523 回答