Change the status bar background color color past iOS 7

前端 未结 8 1222
既然无缘
既然无缘 2020-12-30 04:02

I want to change background color of status bar on iOS 7, and I\'m using this code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp         


        
8条回答
  •  有刺的猬
    2020-12-30 04:36

    Objective c

    (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    
        [[UIApplication sharedApplication] setStatusBarHidden:false];
        UIView *statusBar=[[UIApplication sharedApplication] valueForKey:@"statusBar"];
        statusBar.backgroundColor = [UIColor redColor];
    
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    
    
    
        return YES;
    }
    

    This is working for me. I hope this will help you too.

提交回复
热议问题