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];  
相關文章
相關標籤/搜索