【发布时间】:2019-08-29 14:00:34
【问题描述】:
上图处于深色模式,在应用委托中进行了以下设置:
if (@available(iOS 13.0, *)) {
self.window.backgroundColor = [UIColor systemBackgroundColor];
}
问题是在深色模式下,顶部的白色应该是黑色的。
我怎样才能做到这一点?
谢谢。
【问题讨论】:
-
在 iOS 13 中,窗口属于场景委托,而不是应用委托。
-
@matt 有趣.. 虽然在应用程序委托中我确实有一个有效的窗口对象:
<UIWindow: 0x7fe94dd08160; frame = (0 0; 375 812); hidden = YES; tintColor = UIExtendedSRGBColorSpace 0.01 0.5 0.401961 1; gestureRecognizers = <NSArray: 0x60000273a2e0>; layer = <UIWindowLayer: 0x60000297ba40>>我想知道为什么它说hidden.. 视图层次结构调试器打印:<UIWindow: 0x7fe94dd08160; frame = (0 0; 375 812); autoresize = W+H; tintColor = UIExtendedSRGBColorSpace 0.0627451 0.501961 0.501961 1; gestureRecognizers = <NSArray: 0x60000273a2e0>; layer = <UIWindowLayer: 0x60000297ba40>>跨度> -
@matt 我现在明白你的意思了..慢慢沉入其中..谢谢
-
@Zsolt 你终于找到解决方案了吗?我在这里遇到了同样的问题。
标签: ios background-color uiwindow ios13