关于交换视图的核心动画问题

时间:2010-04-28 17:02:43

标签: iphone-sdk-3.0 uikit uiview interface-builder core-animation

-(IBAction)buttonPressed1:(id)sender 
{
SignView *tempVC = [[SignView alloc] initWithNibName:@"SignView" bundle:Nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDelay:0.0f];
[UIView setAnimationDuration:0.2f];
[self presentModalViewController:tempVC animated:YES];
[tempVC passDataWithString:button1.titleLabel.text andColor:currentlySelectedColor isNightModeOn:nightMode.on];
[UIView commitAnimations];
} 

任何人都可以帮我弄清楚为什么这段代码不起作用?

1 个答案:

答案 0 :(得分:1)

此方法将调用beginAnimations:和commitAnimations,它们不能嵌套。

[self presentModalViewController:tempVC animated:YES];

所以将它移到beginAnimations之前:或者在commitAnimations之后。