hide status bar swift 4

后端 未结 15 1862
无人及你
无人及你 2021-02-04 01:51

I am trying to hide status bar in one of my UIViewControllers (Swift 4).

  • Firstly, I set View controller-based status bar appearance to

15条回答
  •  余生分开走
    2021-02-04 02:47

    None of these worked for me either working on a converted project in iOS 11. Here's what I did. I added this code in the AppDelegate

    func application(_ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool
    {
        application.isIdleTimerDisabled = true
        application.isStatusBarHidden = true
        return true
    }
    

提交回复
热议问题