swift - Is there a way to hide the navigation bar controller but not the status bar in IOS? -


for reason, want hide navigation bar not status bar(the signal, time, battery). when use

self.navigationcontroller?.navigationbarhidden = true 

this hides navigation bar hides status bar. there way avoid this?

thanks

use code hide navigation bar:

navigationcontroller?.setnavigationbarhidden(true, animated: true) 

and use code unhide status bar:

override func prefersstatusbarhidden() -> bool {     return false } 

and check plist file if view controller-based status bar appearance set no change yes shown in below image:

enter image description here


Comments