Reputation: 329
When I run my application, you can see the navigation bar animates in very quickly, it seems like I only catch the end. The animation also seems like it slides down from the top. I have written no code for it to do this! That's why it's weird!
Here's the weirder thing. In the info.plist if I set "View controller-based status bar appearance" to "NO" this does NOT happen. It only happens when I set it to "YES"!
I want "View controller-based status bar appearance" to be set to "YES" because I want to be able to turn it off on specific view controllers using:
override func prefersStatusBarHidden() -> Bool {
return true
}
Please help!
Upvotes: 1
Views: 216
Reputation: 2494
Pay attention to View controller-based status bar appearance
in plist file, it means, that you will determine logic of status bar inside your app.
Do you assume that UIStatusBar
and UINavigationBar
are the same?
Definetly not.
So you function:
override func prefersStatusBarHidden() -> Bool {
return true
}
is hiding status bar (20px bar with battery, clocks and mobile cell).
If you want to change it's animation you should use:
override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation {
return .None
}
If you want to hide UINavigationBar
in some view controller, you should call inside view controller:
navigationController?.setNavigationBarHidden(true, animated: false)
Upvotes: 1