Hiding status bar not working Swift 3, Xcode 8.0

2019-09-20 04:49发布

Set Target/General/Deployment info to Hide status bar. Set None for Status Bar in VCs in storyboards. Added the following code to all VCs.

override var prefersStatusBarHidden: Bool {
    return true
}

Briefly hides status bar but immediately reappears.

1条回答
你好瞎i
2楼-- · 2019-09-20 05:16

Only the prefersStatusBarHidden of the root-level view controller matters — here, the split view controller. The split view controller wants a status bar; it gets a status bar. That is all that matters.

You could try subclassing UISplitViewController, setting prefersStatusBarHidden in your subclass, and using that subclass in the app.

查看更多
登录 后发表回答