English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Implementation Method of Hiding Status Bar in iOS Development
Solution:
IOS7The following versions hide the UIStatusBar method:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [application setStatusBarHidden:YES]; return YES; }
Upgrade to iOS7The method after
Override this method in the base class UIViewController.h
- (BOOL)prefersStatusBarHidden NS_AVAILABLE_IOS(7_0); // Defaults to NO [objc] view plaincopyprint? - (BOOL)prefersStatusBarHidden { // iOS7After, [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; // It is no longer working return YES; }
Thank you for reading, I hope it can help everyone, thank you for your support to this site!