Search code examples
iosobjective-cuinavigationcontrollerstatusbar

Dynamically hiding status bar


I want to hide the status bar at the click of a button. I have tried:

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

I have had no luck with this. Am I missing something?


Solution

  • The simple way is, go to the info.plist file. add row, "View controller-based status bar appearance" and set to NO. Check as an answer