2011-02-28 85 views

回答

7
 [UIView transitionWithView:superView duration:1.0 
         options:UIViewAnimationOptionTransitionCurlUp 
        animations:^{ 
         [self.view removeFromSuperview]; 
         [superView addSubview:newView]; 
        } 
        completion:NULL]; 
1

您可能需要設置動畫過渡:
[UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO]; //your code [UIView commitAnimations];

+0

不,我不想用這個,因爲那麼對多個動畫進行排序變得困難。 – 2011-02-28 10:50:34

+0

你能解釋一下你想要的東西嗎? – Tobias 2011-02-28 13:37:01

0

//嘗試的UIView直接或UI的ViewController

[UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:1.0]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self cache:YES]; 
    [UIView commitAnimations]; 
0

我正確的它工作在改變的UIView作爲您的看法替代superview:

[UIView transitionWithView:self.parentViewController.view duration:1.0 
          options:UIViewAnimationOptionTransitionCurlUp 
         animations:^{ 
          [self.view removeFromSuperview]; 
          [self.parentViewController.view addSubview:self.newVC.view]; 
         } 
         completion:NULL]; 
相關問題