簡體   English   中英

單擊后退按鈕為iPhone屏幕動畫

[英]animate iphone screen on clicking back button

我正在創建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上的“后退”按鈕時,我想應用相同的動畫效果。

任何想法如何做到這一點?

下面的這個問題的幫助下欺騙了...

-(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];
}

感謝所有幫助...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM