Reputation: 11320
Currently, the status bar is not showing up in my iOS emulator. Does anyone know how I can fix this? It shows up on my storyboard but not when I run the simulator.
Upvotes: 1
Views: 5691
Reputation: 10198
Add this to Your code:
[[UIApplication sharedApplication] setStatusBarHidden:NO];
And don't use this, because it's deprecated:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Upvotes: 4
Reputation: 2475
There are ways to manipulate the status bar both programmatically and through configuration. As other answers have stated, you can use:
[[UIApplication sharedApplication] setStatusBarHidden:NO];
If you prefer a consistent configuration for your application, you can modify your app's info.plist. It's likely that you aren't seeing the status bar because your Info plist is configured to hide it.
You can add an entry in the Info plist for Status bar is initially hidden with a Boolean value of YES or NO. Additionally, you can customize the look of the status bar in the Info plist through the Status bar style key.
Upvotes: 0
Reputation: 1320
In addition to Simon's answer make sure in your Info.plist that if you have the "Status bar is initially hidden" it is set to "NO" if you don't see a row with this text that just means it's the default, "NO". My guess is it's likely just the simulator, as it's a bit hard to add the [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
line into your code by mistake. Follow Simon's answer to reset the iOS Simulator if that doesn't work check try checking your Info.plist.
Upvotes: 0
Reputation: 3717
If it's a problem with the simulator itself you can always try iOS Simulator » Reset Content and Settings…. If it is in your app try
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Upvotes: 2