当前位置:编程学习 > wap >>

如何实现 iOS 自定义状态栏

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

 

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,