2013-03-05 110 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