Iphone 导航栏与状态栏重叠

Iphone 导航栏与状态栏重叠,iphone,ios,objective-c,xcode,cocoa-touch,Iphone,Ios,Objective C,Xcode,Cocoa Touch,我在ios6.0和ios6.0.1上遇到了一个非常奇怪的问题 每当我从任何视图控制器显示模式视图,然后关闭该模式视图时,我的父视图控制器的导航栏(显示模式视图的位置)与状态栏重叠。这在ios6.0和ios6.1模拟器上运行良好,但在设备上会出错 我的Xcode版本是4.6 这就是我如何表达我的情态: UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewCon

我在
ios6.0
ios6.0.1
上遇到了一个非常奇怪的问题

每当我从任何视图控制器显示模式视图,然后关闭该模式视图时,我的父视图控制器的导航栏(显示模式视图的位置)与状态栏重叠。这在
ios6.0
ios6.1
模拟器上运行良好,但在设备上会出错

我的Xcode版本是4.6

这就是我如何表达我的情态:

UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:iViewController];
[aNavigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self presentModalViewController:aNavigationController animated:YES];
[aNavigationController release];
[self dismissModalViewControllerAnimated:YES];
这就是我如何抛弃我的情态:

UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:iViewController];
[aNavigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self presentModalViewController:aNavigationController animated:YES];
[aNavigationController release];
[self dismissModalViewControllerAnimated:YES];
请在取消模式后查看随附的导航栏屏幕截图:


我把它修好了。这是因为当我的RootViewController启动时,它会阻止旋转,直到动画完成。完成后,它允许再次旋转。问题是它在所有方面(包括肖像)都返回NO。视图显示的很好,但当我呈现一个模态并返回时,视图几何体被破坏了。一旦我将其更改为即使在动画期间也返回YES(是),问题就消失了

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)iOrientation {
    return (iOrientation == UIInterfaceOrientationPortrait);
}