ios statusBar背景色

http://www.2cto.com/kf/201410/342382.html

第一个方法:

//    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;

//    self.navigationController.navigationBar.tintColor = [UIColor blackColor];

//    self.view.window.frame = CGRectMake(0, 20, self.view.window.frame.size.width, self.view.window.frame.size.height - 20);

//    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];

    

    第二个方法:

下面这个方法好像有个前提,默认的状态栏必须是隐藏的。

    UIView *statusBarView=[[UIViewalloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 20)];

    statusBarView.backgroundColor= LabelRedColor;

    [self.viewaddSubview:statusBarView];

 

    [[UIApplicationsharedApplication] setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];

你可能感兴趣的:(StatusBar)