IOS 导航条 以及 状态栏颜色 相关设置

局部导航栏颜色设置

//设置导航条颜色 美团导航栏颜色
    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中状态栏颜色黑色的问题。
scribe

==================Old===================
* 首先在info.plist中添加一条UIViewControllerBasedStatusBarAppearance,值为NO
* 再在程序里写下面的语句

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值