Objective c 取消设置UIView的动画转换
我使用以下代码在视图上设置翻转过渡动画:Objective c 取消设置UIView的动画转换,objective-c,cocoa-touch,uikit,uiview,core-animation,Objective C,Cocoa Touch,Uikit,Uiview,Core Animation,我使用以下代码在视图上设置翻转过渡动画: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; [self.view addSubview:anotherViewController.view];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view addSubview:anotherViewController.view];
[UIView commitAnimations];
但是,当我在上面的UIPageViewController内的代码片段中切换到此view self.view时,视图将翻转,而不是从左侧或右侧滑入
视图翻转后,如何取消设置此动画过渡?转换完成后,我尝试调用[self.view.layer removeAllAnimations],但没有任何效果。我确定在更改页面视图的当前页面时,执行动画的函数正由通知回调调用。希望其他人能从这个答案中受益,因为他们意识到动画设置在动画块结束时会被丢弃[UIView beginAnimation]和[UIView commitAnimation]之间的任何代码