局部导航栏颜色设置
//设置导航条颜色 美团导航栏颜色
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:78.0/255 green:238.0/255 blue:218.0/255 alpha:1.0];
//设置导航条文字颜色 白色
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
//设置按钮文字颜色 白色
self.navigationController.navigationBar.setTintColor = [UIColor whiteColor]];
全局导航栏颜色设置
/*在 AppDelegate.m 中*/
//设置导航条颜色 美团导航栏颜色
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:78.0/255 green:238.0/255 blue:218.0/255 alpha:1.0]];
//设置导航条文字颜色 白色
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
//设置按钮文字颜色 白色
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
//设置导航栏按钮字体大小
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont boldSystemFontOfSize:15], UITextAttributeFont,nil] forState:UIControlStateNormal];
更改状态栏颜色白色
===============2015.11.22=================
突然发现了在General里面调节StatusBarStyle就可以了,这样还可以解决LaunchScreen.storyboard中状态栏颜色黑色的问题。
==================Old===================
* 首先在info.plist中添加一条UIViewControllerBasedStatusBarAppearance,值为NO
* 再在程序里写下面的语句
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];