简体   繁体   English

XR (Swift) 上的状态栏消失了

[英]Status Bar Disappeared on XR (Swift)

The status bar has disappeared on some viewControllers!某些 viewController 上的状态栏消失了! The "ears" around the notch, and some space below, are now covered with a sold black bar.槽口周围的“耳朵”和下方的一些空间现在覆盖着一个黑色的条。

I am using a UITabBarController with 4 viewControllers - the status bar appears on two of them, but not the other two.我正在使用带有 4 个 viewController 的 UITabBarController - 状态栏出现在其中两个上,但没有出现在另外两个上。

It just began happening, and occurs in both portrait and landscape.它刚刚开始发生,并且发生在肖像和风景中。 What might be causing this?这可能是什么原因造成的? What might I have done?我可能做了什么? (Xcode 10.1, XR simulator) (Xcode 10.1,XR 模拟器)

在此处输入图片说明

在此处输入图片说明

I accidentally changed the background color to .clear by un-commenting it in the VC's class:通过在 VC 的类中取消注释,我不小心将背景颜色更改为 .clear:

    //backgroundColor = .red
    backgroundColor = .blue
    backgroundColor = .clear

Which also explains why it happened in two of the viewControllers (the two that use that class).这也解释了为什么它发生在两个 viewControllers(使用那个类的两个)中。

Though I am not sure why .clear makes the status bar black...虽然我不确定为什么 .clear 使状态栏变黑......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM