因此,这个问题的各种迭代似乎已多次在本网站上提出,但它们似乎都不适用于我的情况。所以我有一个登录屏幕,成功登录后翻转到导航控制器。当它翻转到导航视图时,导航栏一直在顶部,然后在动画完成后向下移动。这不会在导航栏上方创建奇怪的空白区域,因为导航栏在动画期间开始嵌入状态栏中。我已经检查过两个视图控制器都启用了状态栏,所以我不确定我需要做些什么来解决这个奇怪的问题。
以下是我如何切换视图
-(void) swapToNavController
{
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewController *coming = nil;
UIViewController *going = nil;
UIViewAnimationTransition transition;
coming = eventsNavController;
going = viewController;
transition = UIViewAnimationTransitionFlipFromRight;
[UIView setAnimationTransition: transition forView:self.window cache:YES];
[coming viewWillAppear:YES];
[going viewWillDisappear:YES];
[going.view removeFromSuperview];
[self.window insertSubview: coming.view atIndex:0];
[going viewDidDisappear:YES];
[coming viewDidAppear:YES];
[UIView commitAnimations];
}