美文网首页iOS Developer
设置status bar style失败原因

设置status bar style失败原因

作者: Roger1219 | 来源:发表于2016-02-25 23:57 被阅读161次

首先在项目 info里添加View controller-based status bar appearance 这一项

然后

1. 该项值为yes时,在不同的页面对应的controller里添加:

override func preferredStatusBarStyle() -> UIStatusBarStyle {

return .LightContent

}

2.该项值为no时,在appdelegate里的didFinishLaunchingWithOptions添加

UIApplication.sharedApplication().statusBarStyle = .LightContent

重点:

在方法1时,必须是最顶层的controller里添加该函数才有意义。否则无效。

例如:有navigationBar时,在navigation bar controller里添加

相关文章

网友评论

    本文标题:设置status bar style失败原因

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