3
我有一个核心动画块,我调用了一个将加载视图控制器的方法。两个视图控制器之间存在自定义转换。但是,当视图控制器构建界面时,所有这些东西都受核心动画的影响。虽然它会产生一些有趣的效果,但我不希望那样;)如何排除核心动画块内的一段代码被动画化?
[UIView beginAnimations:@"jump to view controller" context:self];
[UIView setAnimationDuration:0.55];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
// some animated property-changes here...
[self loadViewControllerForIndex:targetIndex]; // everything that happens in this method shall not be animated
UIViewController *controller = [viewControllers objectAtIndex:targetIndex];
[controller viewWillAppear:YES];
[controller viewDidAppear:YES];
[UIView commitAnimations];
不幸的是,我不能将该部分移出块。
这难道不是一样+ CATransaction setDisableActions:是]在动画块内? – 2011-08-10 19:35:23