IOS 导航条 以及 状态栏颜色 相关设置
2015-12-07 10:20
531 查看
局部导航栏颜色设置
//设置导航条颜色 美团导航栏颜色 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];
相关文章推荐
- iOS之__block和__weak使用
- iOS 21种设计模式之抽象工厂(Abstract Factory)
- iOS开发之多线程基础
- iOS开发之如何跳到系统设置里的WiFi界面
- iOS沙盒的文件操作
- iOS XCode 不同版本 等开发工具下载
- ios工程图片资源注意点
- IOS开发之启动画面延时
- Vickate_iOS内存与性能优化(随笔)
- IOS开发之协议 代理
- iOS开发-进阶:NSUserDefaults 简介,使用 NSUserDefaults 存储自定义对象
- iOS开发-工具:CocoaPods使用详细说明
- iOS开发-工具:Xcode7中添加pch文件
- iOS 远程推送消息时运行在前台怎么处理
- 百度云推送的iOS证书配置
- 百度云推送没有收到消息怎么破 iOS
- iOS中tableView
- iOS_block内存分析
- iOS_ @property参数分析
- iOS-设计模式之Block