Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 取消设置UIView的动画转换_Objective C_Cocoa Touch_Uikit_Uiview_Core Animation - Fatal编程技术网

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]之间的任何代码