2011-10-04 212 views
1

我使用下面的代碼在Xcode至2次之間的水平翻轉在iPhone應用程序模態視圖控制器

-(IBAction)switchView:(id)sender{ 
    Algorithm2ViewController *Algorithm2ViewControllergo = [[Algorithm2ViewController alloc] 
                  initWithNibName:@"Algorithm2ViewController"             bundle:nil]; 

    [UIView beginAnimations:@"flipview" context:nil]; 
    [UIView setAnimationDuration:1]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft 
          forView:self.view cache:NO]; 
    [self.view addSubview:Algorithm2ViewControllergo.view]; 

    [UIView commitAnimations]; 
} 

第一翻轉後,我完成之前獲得在後臺未來視圖的圖像翻轉如何擺脫它?

回答

0

我已經在第二視圖這出添加以下代碼

-(IBAction)switchView2:(id)sender{ 

    SecondViewController *SecondViewControllergo = [[SecondViewController alloc] 
                initWithNibName:@"SecondView" 
                bundle:nil]; 

    [UIView beginAnimations:@"flipview" context:nil]; 
    [UIView setAnimationDuration:2]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft 
          forView:self.view.superview cache:NO]; 
    [self.view addSubview:SecondViewControllergo.view]; 
    [self.view removeFromSuperview]; 
    [UIView commitAnimations]; 
    [SecondViewControllergo release]; 


} 

從上海華線的刪除將去掉的背景圖像