一.在info.plist文件中添加一行不但要在 Status bar is initially hidden一行,选择为 YES。
二.在didFinishLaunchingWithOptions方法里添加
1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 2 3 [UIApplication sharedApplication].statusBarHidden = NO; 4 5 return YES; 6 }
statusBarHidden设置为NO就是显示状态栏。
statusBarHidden设置为YES就是隐藏状态栏。
原文:http://www.cnblogs.com/mancong/p/5128159.html