2013-02-19 170 views
3

我面临着一个很奇怪的问题iOS 6.0 & iOS 6.0.1导航栏重叠状态栏

每当我从任何视图控制器呈现模态视图,然后消除该模态视图,我父视图控制器的导航栏(从呈现模态视图的位置)与状态栏重叠。这工作正常iOS 6.0 & iOS 6.1模拟器,但在设备上它弄乱了。

我的Xcode版本是4.6。

这是我如何展示我的情态:

UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:iViewController]; 
[aNavigationController.navigationBar setBarStyle:UIBarStyleBlack]; 
[self presentModalViewController:aNavigationController animated:YES]; 
[aNavigationController release]; 

这是我如何解雇我的情态:

[self dismissModalViewControllerAnimated:YES]; 

请参阅我的导航栏的附截图驳回模式后:

enter image description here

回答

3

我把它定势d。这是因为当我的RootViewController启动时,直到动画完成后,它才会旋转。一旦完成,它就会再次旋转。问题在于它在所有方面(包括肖像)都返回NO。视图显示很好,但是当我呈现一个模式并返回时,视图几何图形被破坏。一旦我将其改为在纵向模式下返回YES以进行纵向模式,问题就消失了。

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