2011-10-04 140 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]; 


} 

从上海华线的删除将去掉的背景图像