如何实现 iOS 自定义状态栏

给大家介绍如何实现 iOS 自定义状态栏

Sample Code:

01 UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];
02     [statusWindow setWindowLevel:UIWindowLevelStatusBar + 1];
03     [statusWindow setBackgroundColor:[UIColor clearColor]];
04      
05     UILabel * statusLabel = [[UILabel alloc] initWithFrame:statusWindow.bounds];
06     statusLabel.text = @"RSSI:";
07     statusLabel.textColor = [UIColor blueColor];
08     statusLabel.textAlignment = NSTextAlignmentCenter;
09     statusLabel.backgroundColor = [UIColor blackColor];
10      
11     [statusWindow addSubview:statusLabel];
12      
13     [statusWindow makeKeyAndVisible];
上一篇:帮助理解委托、匿名委托、Lambda表达式还有事件


下一篇:Asp.Net Core实战