我在我的项目上创建了在 2 个 UIWebView 之间切换的动画。当我在 iOS 3.2 上开发时,动画一切都很好。但是当我迁移到 iOS 4.2 时,突然一切都出错了:
//LeftView Animation
[UIView beginAnimations:@"leftPortrait" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:leftView cache:YES];
[leftWebView setFrame:CGRectMake(0, 0, 384, 916)];
[UIView commitAnimations];
//RightView Animation
[UIView beginAnimations:@"rightPortrait" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:rightView cache:YES];
[rightWebView setFrame:CGRectMake(0, 0, 384, 916)];
[UIView commitAnimations];
谢谢!