标签:
当系统版本号高于iOS7.0,那么原来的隐藏状态栏方式就可能不好使了. 因为你要是用修改plist的方法实现的隐藏方法,还是管用的.
1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(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及以上 9 [self prefersStatusBarHidden]; 10 //这个是更新状态栏的显示状态,只支持iOS7及以上,使用performSelector是为了不影响主线程的其他工作 11 [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; 12 } 13 return YES; 14 } 15 16 - (BOOL)prefersStatusBarHidden 17 { 18 return YES;//隐藏为YES,显示为NO 19 }
标签:
原文地址:http://www.cnblogs.com/huyp/p/5164230.html