gpt4 book ai didi

iOS 顶部栏不显示

转载 作者:行者123 更新时间:2023-11-29 00:04:03 25 4
gpt4 key购买 nike

我试图在 Xcode 9 Swift 4 中显示顶部栏。在我的 Storyboard中,它显示顶部栏,如下图所示:

storyboard top bar

但是当我运行它时,我得到的是没有顶部栏的:

enter image description here

我尝试使用带有标题的导航栏,但它显示为:

enter image description here

运营商、wifi、时间和电池背景仍然是白色。如果我将导航栏设置到屏幕顶部,它将像这样覆盖它们:

enter image description here

为什么顶部栏没有显示?如何实现这样的目标?:

enter image description here

更新

顶部栏不是导航栏。它只是一个显示标题的栏。如下图所示,注册场景没有导航栏。我从右侧的属性中添加了顶部栏。

enter image description here

最佳答案

在倒数第二个屏幕中,导航栏覆盖了它:

enter image description here

它并没有真正覆盖它——但是状态栏的文本是黑色的,所以你看不到它。要更改它,请在 GrolocationNewsViewController(或任何您称之为它的名称)的实现中覆盖 preferredStatusBarStyle 并返回 .lightContent:

class GrolocationNewsViewController: UIViewController {

// rest of the code

override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}

关于iOS 顶部栏不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48633953/

25 4 0