iOS 6中状态栏色调颜色变为黑色 [英] Status bar tint color changes to black in iOS 6

查看:290
本文介绍了iOS 6中状态栏色调颜色变为黑色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显然不明白如何使用iOS 6中的状态栏色调。我读过这个问题:
更改状态栏色调颜色
但是实施建议的解决方案尚未解决问题。



我已在目标摘要窗格中配置了设置(样式和着色的默认设置),并将状态栏色调参数字典添加到我的info.plist中,如WWDC 2012中所述高级外观定制。



我的状态栏在启动时正确显示,但是一旦我导航到另一个视图控制器,状态栏就会变为黑色。



第二个视图控制器嵌入在自己的导航控制器中。这可能是问题的根源吗?



无论原因是什么,我希望有人可以提供一个解决方案,让我可以让我的状态栏始终保持一致我的应用程序。



如果有任何需要澄清的话请告诉我,并提前感谢您的任何帮助。

解决方案

今天我遇到了同样的问题,但没有一个消化的答案会帮助我。



由于我定义了自己的颜色(红色,蓝色,绿色,alpha),我不想通过IB添加UIStatusBar,我需要一个单线解决方案。



经过一段时间的测试,以下内容对我有用:


  1. 在项目摘要中选择状态栏样式来自下拉菜单的Black Transculent。

  2. 应用程序中:didFinishLaunchingWithOptions:输入以下代码行:



  3. self.window.backgroundColor = [UIColor redColor]; //示例颜色


当通过以下方式设置样式时,这对我来说不起作用应用程序中的代码:didFinishLaunchingWithOptions:



享受!


I am apparently not understanding how to use the status bar tint in iOS 6. I have read this question: Change statusbar tint colour but implementing the solutions suggested there has not resolved the issue.

I have configured the settings in the target summary pane (default for style and tinting) and added the status bar tint parameters dictionary to my info.plist as described in WWDC 2012 Advanced Appearance Customization.

My status bar tints correctly at launch but once I navigate to another view controller the status bar changes to black.

The second view controller is embedded in its own navigation controller. Could this be the root of the issue?

Whatever the cause, I am hoping that someone can offer a solution that will allow me to make my status bar be tinted consistently throughout my application.

Please let me know if anything needs clarification and thanks in advance for any assistance.

解决方案

Today I ran into the same issue, but none of the sugested answers would help me.

Since I defined my own color (red, blue, green, alpha), I did not want to add a UIStatusBar via IB, I need a one-line-solution.

After testing for a while the following worked for me:

  1. In the Project Summary select Status Bar Style Black Transculent from the drop down menu.
  2. In application: didFinishLaunchingWithOptions: enter the following line of code:

    self.window.backgroundColor = [UIColor redColor]; //example color

Somehow this would not work for me when setting the style via code in application: didFinishLaunchingWithOptions:

Enjoy!

这篇关于iOS 6中状态栏色调颜色变为黑色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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