iOS statusBar 状态栏定制

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS statusBar 状态栏定制相关的知识,希望对你有一定的参考价值。

 1 UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];  
 2 [statusWindow setWindowLevel:UIWindowLevelStatusBar + 1];  
 3 [statusWindow setBackgroundColor:[UIColor clearColor]];  
 4   
 5 UILabel * statusLabel = [[UILabel alloc] initWithFrame:statusWindow.bounds];  
 6 statusLabel.text = @"RSSI:";  
 7 statusLabel.textColor = [UIColor blueColor];  
 8 statusLabel.textAlignment = NSTextAlignmentCenter;  
 9 statusLabel.backgroundColor = [UIColor redColor];  
10   
11 [statusWindow addSubview:statusLabel];  
12 [statusWindow makeKeyAndVisible];  

 

以上是关于iOS statusBar 状态栏定制的主要内容,如果未能解决你的问题,请参考以下文章