XCode 6-b3 (Swift) 中状态栏的颜色文本 [英] Color text of status bar in XCode 6-b3 (Swift)

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

问题描述

我尝试修改状态栏颜色文本,但没有人回答 此线程 不起作用.有没有特别适用于 XCode 6?

I've try to modify status bar color text but no one answer from this thread doesn't work. Any especially for XCode 6?

我试过插入:

override func preferredStatusBarStyle() -> UIStatusBarStyle {
    return UIStatusBarStyle.LightContent
}

UIViewController

还有

UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

AppDelegate.swift我已经尝试在 info.plist 中更改它但它不影响它.如何将状态栏颜色文本更改为白色?

to AppDelegate.swift And I've tried change it in info.plist But it doesn't affect it. How change status bar color text to white?

推荐答案

在您的 Info.plist 中,您需要将 基于视图控制器的状态栏外观 定义为任何值.

In your Info.plist you need to define View controller-based status bar appearance to any value.

如果你定义了它YES,那么你应该覆盖每个视图控制器中的 preferredStatusBarStyle 函数.

If you define it YES then you should override preferredStatusBarStyle function in each view controller.

如果你定义它NO,那么你可以使用

If you define it NO then you can set style in AppDelegate using

UIApplication.sharedApplication().statusBarStyle = .LightContent

这篇关于XCode 6-b3 (Swift) 中状态栏的颜色文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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