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设为负的

猜你喜欢

转载自blog.csdn.net/f9999999995/article/details/85699521
今日推荐