gpt4 book ai didi

iphone - 导航栏被状态栏重叠

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:05:18 29 4
gpt4 key购买 nike

我在 iOS 6.0iOS 6.0.1 上遇到了一个非常奇怪的问题。

每当我从任何 View Controller 呈现模态视图然后关闭该模态视图时,我的父 View Controller (从我呈现模态视图的地方)的导航栏就会与状态栏重叠。这在 iOS 6.0iOS 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

最佳答案

我修好了。这是因为当我的 RootViewController 启动时,它会暂停旋转,直到动画完成。完成后,它会再次允许轮换。问题是它在所有方面(包括肖像)都返回 NO。 View 显示正常,但是当我呈现模态并返回时, View 几何形状被破坏了。一旦我将其更改为即使在动画期间也为纵向模式返回 YES,问题就消失了。

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

关于iphone - 导航栏被状态栏重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14969356/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com