现在的位置: 首页 > 综合 > 正文

在statusBar 后面添加一层视图方法

2017年11月30日 ⁄ 综合 ⁄ 共 318字 ⁄ 字号 评论关闭

在statusBar 后面添加一层视图方法:

在AppDelegate.h 里面定义一个 变量 UIWindow *statusBarBack;

在AppDelegate.m里面进行初始化

statusBarBack = [[UIWindow alloc]initWithFrame:[UIApplication sharedApplication].statusBarFrame];

statusBarBack.backgroundColor = [UIColor blackColor];

[statusBarBack setWindowLevel:UIWindowLevelStatusBar - 1];

[statusBarBack makeKeyAndVisible];

抱歉!评论已关闭.