我有一个具有 UIWebView 和 OptionsPane 的视图(带有自定义视图的自定义 UIViewController)。
我希望在显示视图时,将选项窗格(位于主视图的顶部)翻转到位。我正在使用代码,我得到了一个奇怪的结果。
第一次显示视图时,选项窗格似乎已经可见...当我在导航控制器上按 BACK 并再次拉起视图时,动画效果完美。
任何人都可以对这个话题有所了解吗?
- (void)viewDidLoad {
[super viewDidLoad];
optionsPane=[[OptionsPaneController alloc] initWithNibName:@"OptionsPane" bundle:nil];
}
- (void)viewWillAppear:(BOOL)animated {
[optionsPane.view removeFromSuperview];
[self checkOptionsVisible];
}
-(void)checkOptionsVisible{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[optionsPane view] cache:YES];
[[self view] addSubview:[optionsPane view]];
[theWebView setFrame:CGRectMake(0,87,320,230)];
[[optionsPane view] setFrame:CGRectMake(0,0,320,87)];
[UIView commitAnimations];
}