swift - 跳转到导航 Controller 时IOS显示状态栏 swift 3

标签 swift uinavigationcontroller statusbar

我将导航 Controller 链接到我的 UIviewcontroller,如下所示:

enter image description here

当我登录时状态栏显示:

enter image description here

当我从另一个 View Controller 返回跳转到导航 Controller 时,使用方法如下:

let loginPageController=self.storyboard?.instantiateViewController(withIdentifier: "navLoginController") as! UINavigationController

UIApplication.shared.statusBarStyle = .default
self.present(loginPageController, animated:true, completion: nil)

状态栏消失了。

enter image description here

有人能解决吗?

最佳答案

1- 在 appDelegate didFinishLaunchingWithOptions 函数中添加此行。

application.isStatusBarHidden = false

2-并在 info.plist 文件中添加此键。 查看基于 Controller 的状态栏外观 -> 是

状态栏永远不会隐藏

关于swift - 跳转到导航 Controller 时IOS显示状态栏 swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40862557/

相关文章:

ios - 用视频播放器动态替换图像

swift - 使用 Swift 从 Parse 中检索图像

ios - Swift 重命名后退导航项

iOS 导航栏在某些标签页上更亮

iphone - 如何仅隐藏/禁用第一个 uinavigationbar?

ios - 如何声明继承的内置协议(protocol),以便可以从另一个框架或应用程序导入它?

ios - NMANavigationManagerDelegate 在 HERE Map iOS SDK 中不起作用

android - 在 Android 4.0.4 上隐藏我的应用程序的 android 状态栏?

macos - 没有窗口的 Mac 应用程序

java - 如何阻止拖动的项目在拖放到状态栏或屏幕按钮上时消失