如何更改UIStatus栏颜色? [英] How to change the UIStatus bar color?

查看:86
本文介绍了如何更改UIStatus栏颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将状态栏颜色更改为黑色半透明。我已经更改了我的Info.plist
UIStatusBarStyle
UIStatusBarStyleBlackTranslucent

I am trying to change the status bar color to Black translucent. I have changed my Info.plist UIStatusBarStyle UIStatusBarStyleBlackTranslucent

我已经将这些代码行添加到applicationDidFinishLaunching :()

And I have added these lines of code also to applicationDidFinishLaunching:()

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];

执行这些更改后,我的状态栏变为黑色半透明,直到我的闪屏出现。有一次,我的应用程序被完全加载,当显示内容时,它再次回到默认的灰色。任何人都可以告诉我我哪里出错或者我应该在哪里更改?

After doing these changes, my status bar changes to black translucent, till my splash screen appears. Once, my application is loaded fully and when the contents are displayed, it is again back to the default gray color.Can anyone please tell me where I am going wrong or where i should change?

提前致谢。

推荐答案

右键单击info.plist和添加行。从那里,您可以选择要添加的内容。有一个名为状态栏样式的值。选那个。相应的值也可以拉下来,你可以选择灰色,黑色,alpha .5,黑色。

Right click on your info.plist and "Add Row". From there you can select what you want to add. There is a value called "Status bar style". Pick that. The corresponding value can also be pulled down and you can pick from gray, black with alpha .5, black.

保存,重新加载你的应用程序。这就是我必须要做的全部。

Save, reload your app. That's all I had to do.

(我知道qn是1个月大,但我认为无论如何我都会留下答案,以防ppl搜索它)。

(I know the qn is 1 month old but I thought I'd leave the answer here anyway in case ppl search for it).

这篇关于如何更改UIStatus栏颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆