IOS

iOS Setting Background Color Method for Status Bar


Set the background color of the status bar

- (void)setStatusBarBackgroundColor:(UIColor *)color

{

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

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

    statusBar.backgroundColor = color;

  }

}