如何更改状态栏背景颜色 [英] How to change status bar background color
本文介绍了如何更改状态栏背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在有没有办法改变状态栏的背景颜色它显示白色和黑色电池图标我想要黑色这里是我在viewDidLoad中使用的代码
Is there way to change the background color of status bar right now it show white with black icons of battery i want the color black here is the code i am using in viewDidLoad
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
推荐答案
将
UIViewControllerBasedStatusBarAppearance
设置为 NO.打电话
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];
有关更多详细信息...请查看此链接
For more details...check this link
尝试添加这个
self.extendedLayoutIncludesOpaqueBars = YES;
这篇关于如何更改状态栏背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文