iOS 8 状态栏保持黑底白字 亲测有效

1.info.plist文件  设置View controller-based status bar appearance的值为no

2.在AppDelegate.m中添加如下代码

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
        [application setStatusBarStyle:UIStatusBarStyleLightContent];
        self.window.clipsToBounds =YES;
        self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
        self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);
    }

效果如下图:

iOS 8 状态栏保持黑底白字 亲测有效_第1张图片

你可能感兴趣的:(UI)