ios开发之状态栏隐藏

//解决方法:
//iOS7以下版本隐藏UIStatusBar的方法:
[objc] view plaincopyprint?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions  
{  
    [application setStatusBarHidden:YES];  
    return YES;  
}  

//升级到iOS7后的方法:
//在基类中重载UIViewController.h中的这个方法
[objc] view plaincopyprint?
- (BOOL)prefersStatusBarHidden NS_AVAILABLE_IOS(7_0); // Defaults to NO  
[objc] view plaincopyprint?
- (BOOL)prefersStatusBarHidden  
{  
    // iOS7后,[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];  
    // 已经不起作用了  
    return YES;  
}  

你可能感兴趣的:(ios开发之状态栏隐藏)