iOS 设置状态栏的背景颜色方法

2020-01-18 22:36:07丽君

设置状态栏的背景颜色


- (void)setStatusBarBackgroundColor:(UIColor *)color

{

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

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

    statusBar.backgroundColor = color;

  }

}

以上这篇iOS 设置状态栏的背景颜色方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持ASPKU。

 


注:相关教程知识阅读请移步到IOS开发频道。