iOS7以下版本都默认有Status Bar,但是iOS7及以上版本就没有了,因此,我们适配一般选择方案是为iOS7添加上Status Bar
1、Info.plist 设置View controller-based status bar appearance 为NO
2、application:didFinishLaunchingWithOptions内:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[application setStatusBarStyle:UIStatusBarStyleLightContent];<span style="font-family: Arial, Helvetica, sans-serif;">//设置statusBar颜色</span>
self.window.clipsToBounds =YES;<span style="font-family: Arial, Helvetica, sans-serif;">//重新计算frame</span>
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}3、在别的子页面可能会遇到Status Bar又消失或者没有字体的情况(其实是默认的是黑色,与背景混在一起了)使用:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
1504

被折叠的 条评论
为什么被折叠?



