hide status bar swift 4

后端 未结 15 1859
无人及你
无人及你 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:34

    I discovered that prefersStatusBarHidden wasn't being called in my view controller because I was using a custom container view and I needed to forward the status bar hiding responsibility to the child view controller. Implementing var childForStatusBarHidden: UIViewController? { return childViewController } in the container view controller fixed if for me.

提交回复
热议问题