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];  

 

posted @ 2016-06-06 16:02  超级马力  阅读(473)  评论(0编辑  收藏  举报