iOS 更改状态栏背景颜色

更改状态栏背景颜色的方法有很多种,在这说两种

一、

// 设置状态栏背景颜色

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

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

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

//        statusBar.backgroundColor = color;

//    }

//}

// 调用

//    [self setStatusBarBackgroundColor:RGB(244, 64, 88)];

二、

创建一个View,把View的y设为负的

你可能感兴趣的:(功能)