2013-03-05 130 views
0

我正在使用页面卷曲动画。我在视图上显示了一个问题,当我点击按钮时,它将页面卷起并显示黑屏。但是我想在页面蜷缩后再次展示不同的问题。如何在页面卷曲动画之后用不同的问题显示相同的视图?显示动画后显示

我使用下面的代码

[UIView beginAnimations:@"partialPageCurlUp" context:nil]; 
    [UIView setAnimationDuration:1.5]; 
    [UIView setAnimationsEnabled:YES]; 
    [UIView setAnimationDelegate:self]; 
    [UIView setAnimationsEnabled:YES]; 
    [UIView 
    setAnimationTransition: UIViewAnimationTransitionCurlUp 
    forView:self.view cache:YES]; 
    [UIView commitAnimations]; 

    [super viewDidLayoutSubviews]; 

只是想知道下一步该怎么做?

+0

你检查http://stackoverflow.com/questions/10022973/page-flip-effect-in-uiscrollview? – 2013-03-05 05:17:54

+0

也检查此:-http://stackoverflow.com/questions/3253432/page-flipping-sample-code – 2013-03-05 05:20:39

+0

检查[此](http://pastebin.com/gaZUBXnf)。 – 2013-03-05 06:07:47

回答

0
[UIView animateWithDuration:0.25 animations: ^{ // your animation code hear } completion:^ (BOOL finished) { if (finished) { // Your Animation Completion call back. NSLog(@"Is completed"); } } ]; 

试试这个方法。

0

看你只需要实现更多的几件事情

添加动画STOP选择在现有的代码,这样你可能会得到动画结束点可以显示下一个问题

[UIView setAnimationDidStopSelector:@selector(animationDidStopFinished)]; 

animationDidStopFinished这将另一method你应该写一些代码,在动画完成后会显示另一个问题。

,或者使用下面的代码

[UIView animateWithDuration:1.5 delay:.00 options:UIViewAnimationTransitionFlipFromLeft animations:^ 
    { 
    //here you should write animation code 
    [UIView 
     setAnimationTransition: UIViewAnimationTransitionCurlUp 
     forView:self.view cache:YES]; 
    } 

    completion:^ (BOOL finished) { 

       if (finished) { 
         // Here You may show Next Question as animation gets stop; 
        } 
       }]; 
+0

不行不行 – 2013-03-05 06:56:11