状态栏背景颜色设置

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
        statusBar.backgroundColor = [UIColor colorWithHexString:@"1a1a1a" alpha:0.4];
    }
    
    self.navigationController.navigationBarHidden = YES;
}

 

posted @ 2018-04-04 00:23  码出境界  阅读(379)  评论(0编辑  收藏  举报