iOS 修改状态栏的颜色方法

  调用: [self setStatusBarBackgroundColor:[UIColor orangeColor]];

 

- (void)setStatusBarBackgroundColor:(UIColor *)color

{

    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];

    

    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)])

    {

        statusBar.backgroundColor = color;

    }

}

 

posted @ 2016-08-30 15:08  tongyuling  阅读(204)  评论(0编辑  收藏  举报