2010-08-04 44 views
0

我使用以下代碼來對動畫的視圖倒裝過渡:當我切換到該視圖中UIPageViewController內側(在上面的代碼段self.view)取消設置一個UIView的動畫過渡

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:1.0]; 
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; 
[self.view addSubview:anotherViewController.view]; 
[UIView commitAnimations]; 

然而, ,視圖翻轉而不是從左側或右側滑入。

如何在視圖翻轉後「取消」此動畫過渡?我在轉換完成後嘗試調用[self.view.layer removeAllAnimations],但它沒有效果。

回答

0

我確定當頁面視圖的當前頁面被改變時,執行動畫的函數被通知回調調用。希望有人會從這個答案中獲益,認識到動畫設置被丟棄到動畫塊的末尾([UIView beginAnimation]和[UIView commitAnimation]之間的任何代碼)。