gpt4 book ai didi

iOS 7 状态栏不在 View 顶部,无需编辑每个 View

转载 作者:行者123 更新时间:2023-11-29 03:37:47 24 4
gpt4 key购买 nike

我已经看到了以下每个问题的答案:

Status bar appear over my view's bounds in iOS 7

Status bar and navigation bar appear over my view's bounds in iOS 7

New iOS 7 statusBar leaves a range 20px in apps compiled in Xcode 5

iOS 7 status bar back to iOS 6 default style in iPhone app?

但是,这些答案似乎都不适合我。我正在尝试以“黑色不透明”样式显示状态栏,正如我在 .plist 中设置的那样。

有什么方法可以让应用程序继续工作,就好像状态栏不包含在窗口中一样?

我已经试过了:

CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0.0f, statusBarHeight, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - statusBarHeight)];

但是,statusBarHeightapplication:didFinishLaunchingWithOptions: 中为 0。手动将其设置为 20.0f 似乎只会搞砸 UIWindow 并且 UIViewController 会比屏幕高。 (还有,手动设置20.0f这个值感觉很脏)

我错过了什么?

编辑

我还应该指出,我正在使用一个隐藏它是 UINaviationBarUINavigationController

编辑 2:

这似乎只是应用程序在调试时或在 Ad Hoc(试飞)版本中出现的问题。 App Store 上完全相同的应用程序显示了它应有的状态栏。为什么这会影响调试和临时发布?

最佳答案

UIViewController.edgesForExtendedLayout设置为UIRectEdge.None

Edges For Extended Layout

关于iOS 7 状态栏不在 View 顶部,无需编辑每个 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18903860/

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