首页 > 移动平台 > 详细

iOS8中如何将状态栏的字体颜色改为白色

时间:2016-01-12 15:26:19      阅读:173      评论:0      收藏:0      [点我收藏+]

网上的一些方法在我这行不通,

比如:

UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent
1、Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file.

2、In the viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];

3、Add the following method:

-(UIStatusBarStyle)preferredStatusBarStyle{ 
    return UIStatusBarStyleLightContent; 
}

最后终于有个方法OK

1、设置Info.plist中的View controller-based status bar appearance为YES

2、然后在AppDelegate.swift中的

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool

方法中加入:

UINavigationBar.appearance().barStyle = UIBarStyle.Black

 

OK,就是这么简单。这样状态栏的字体就变成白色了!

iOS8中如何将状态栏的字体颜色改为白色

原文:http://www.cnblogs.com/Free-Thinker/p/5124138.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!