Hide the status bar for iOS and the status bar for ios
When the system version is higher than iOS7.0, the original method of hiding the status bar may not be easy to use, because if you use the method of modifying plist to implement the hidden method, it still works.
Plist method:Key: Status bar is initially hidden value: YES since the program is enabled, the status bar has been hidden. key: View controller-based Status bar appearance value: YES after the program enters the status bar, the Status bar is hidden. (that is, the status bar is displayed when Default.png is displayed on the welcome screen)
Code method:The disadvantage of the code method is that the status bar of the welcome screen cannot be hidden. because when the welcome screen is enabled, appDelegate has not executed didFinishLaunching. the advantage is that the status bar can be displayed in the specified ViewController. You only need to change "YES" of the Code to "NO ".
1-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {2 // Override point for customization after application launch. 3 if ([UIDevice currentDevice]. systemVersion. floatValue <7.0) {4 [UIApplication sharedApplication]. statusBarHidden = YES; 5} 6 else if ([self respondsToSelector: @ selector (setNeedsStatusBarAppearanceUpdate)]) 7 {8 // iOS7 and above 9 [self prefersstatushidbarden]; 10 // This is the display status of the update status bar. It only supports iOS7 and later versions. The use of javasmselector is to avoid affecting other work of the main thread. 11 [self defined mselector: @ selector (setNeedsStatusBarAppearanceUpdate)]; 12} 13 return YES; 14} 15 16-(BOOL) prefersStatusBarHidden17 {18 return YES; // hide as YES and display as NO19}