iOS 自定义状态栏

Sample Code:

UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];
    [statusWindow setWindowLevel:UIWindowLevelStatusBar + 1];
    [statusWindow setBackgroundColor:[UIColor clearColor]];
    
    UILabel * statusLabel = [[UILabel alloc] initWithFrame:statusWindow.bounds];
    statusLabel.text = @"RSSI:";
    statusLabel.textColor = [UIColor blueColor];
    statusLabel.textAlignment = NSTextAlignmentCenter;
    statusLabel.backgroundColor = [UIColor blackColor];
    
    [statusWindow addSubview:statusLabel];
    
    [statusWindow makeKeyAndVisible];

你可能感兴趣的:(ios,自定义状态栏,UIWindow)