iOS设置状态栏颜色

//czq 设置状态栏颜色

- (void)setStatusBarBackgroundColor:(UIColor*)color {

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

    if ([statusBarrespondsToSelector:@selector(setBackgroundColor:)]) {

        statusBar.backgroundColor= color;

    }

}

[self setStatusBarBackgroundColor:MainColor];

你可能感兴趣的:(iOS设置状态栏颜色)