我面临一个非常奇怪的问题iOS 6.0
& iOS 6.0.1
.
每当我从任何视图控制器呈现模态视图然后关闭该模态视图时,父视图控制器的导航栏(从我呈现模态视图的位置)就会与状态栏重叠。这运行良好iOS 6.0
& iOS 6.1
模拟器,但在设备上它会搞砸。
My 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](https://i.stack.imgur.com/hl14T.png)
我把它修好了。这是因为当我的 RootViewController 启动时,它会暂停旋转,直到动画完成。一旦完成,它就允许再次旋转。问题是它在所有方面(包括肖像)都返回“否”。视图显示得很好,但是当我呈现模态并返回时,视图几何形状被破坏了。一旦我将其更改为即使在动画期间也为纵向模式返回 YES,问题就消失了。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)iOrientation {
return (iOrientation == UIInterfaceOrientationPortrait);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)