I recently made a change to my project (Adding SWRevealController and Removing my TabbarController), and all of a sudden my status bar won't hide.
I have tried the following solutions:
Hiding via IB Hiding in my base view controller using
(BOOL)prefersStatusBarHidden
Hiding using this code in viewdidload.
[self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
在您的应用程序plist文件中添加一行,将其称为“基于视图控制器的状态栏外观”并将其设置为NO。
try this method
- (BOOL)prefersStatusBarHidden {
return YES; }
You can hide the status bar in your project General Settings.
Click on YourApplication Target. Click on General Tab.
select Hide During Application Launch
option in Deployment Info Section.
I am adding a screenShot for your convenience.
Your Project provide itself the option of hiding the status bar so why to add the same property in the .plist file.
Enjoy Coding...!!!!
I am not 100% convinced, but the problem seemed to resolve when I added "Status bar is initially hidden" = YES to my PLIST file. I don't understand why, but it seems to have done the trick.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.