SoFunction
Updated on 2025-04-03

iOS How to set background color of 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:)]) {

     = color;

  }

}

The above method of setting the background color of the status bar on iOS is all the content I share with you. I hope you can give you a reference and I hope you can support me more.