翻转视图animation不工作

我正在研究一个iPad应用程序,在视图中向用户提出问题。 当他们回答这个问题时,我希望这个观点转向另一个包含下一个问题的观点。 为了使它看起来很花哨,我正在试图添加一个curl转换,但我写的代码不起作用,我可以看不到find问题。 它确实显示正确的视图,但没有过渡animation。 那是什么? 以下是我用来转换的方法:

- (void)pageChangedTo:(NSInteger)page { if ( (page == currentQuestionNumber) || (page > ( [self.allQuestions count] - 1 ) ) || (page < 0) ) { return; } AskQuestionView *view = [self.questionViews objectAtIndex:page]; UIViewAnimationTransition transition; if (page > currentQuestionNumber) { transition = UIViewAnimationTransitionCurlUp; } else { transition = UIViewAnimationTransitionCurlDown; } if (self.containerView1.superview) { self.containerView2 = view; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:transition forView:self.containerView1 cache:YES]; [self.containerView1 removeFromSuperview]; [askQuestionsView addSubview:self.containerView2]; [UIView commitAnimations]; } else { self.containerView1 = view; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:transition forView:self.containerView2 cache:YES]; [self.containerView2 removeFromSuperview]; [askQuestionsView addSubview:self.containerView1]; [UIView commitAnimations]; } currentQuestionNumber = page; } 

谁能告诉我为什么这不起作用? 我将非常感激!

设置您的animation转换为:_self.containerView2的_ 容器 :不是被删除的,而是被删除的。