美文网首页
把视图放到StatusBar上面

把视图放到StatusBar上面

作者: 瞬csr | 来源:发表于2017-05-22 16:54 被阅读4次

window有一个属性windowLevel

statusView.windowLevel = UIWindowLevelAlert;

初始化statusView,可在其上添加控件

statusView = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];
statusView.windowLevel = UIWindowLevelAlert;
statusView.backgroundColor = [UIColor orangeColor];
 //显示statusView,不写该段代码无法显示
statusView.hidden = NO;

这样该window就会覆盖在statusBar上面。

相关文章

网友评论

      本文标题:把视图放到StatusBar上面

      本文链接:https://www.haomeiwen.com/subject/yxcixxtx.html