1.设置navigationbar背景颜色

[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];

PS:如果颜色不对,可能是因为默认的半透明玻璃效果导致的,要关闭使用

self.navigationController.navigationBar.translucent = NO;

再PS:如果修改了颜色一点反应都没,则需要隐藏/显示

2.设置按钮颜色

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

3.设置标题颜色及大小

方法1:

UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 144)];

title.text = @"帮助";

title.textAlignment = NSTextAlignmentCenter;

title.textColor = [UIColor whiteColor];

title.font = [UIFont systemFontOfSize:20];

self.navigationItem.titleView = title;

方法2:

[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor,[UIColor colorWithRed:0 green:0.7 blue:0.8 alpha:1], UITextAttributeTextShadowColor,[NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset,[UIFont fontWithName:@"Arial-Bold" size:0.0],UITextAttributeFont,nil]];

4.navigationbar默认高度为44

最新文章

  1. SSH框架简化(struts2+spring+hibernate)
  2. EF架构~数据分批批量提交
  3. WEB前端知识在乱花渐欲迷人眼的当下,如何分清主次和学习优先级呢?
  4. Cocos2dx淌坑日记:粒子系统PositionType的正确使用
  5. Linux常用指令---$PATH (环境变量)
  6. ACM题目————二叉树的遍历
  7. IOS 支付宝、微信回调传值给H5网页
  8. (原)工具篇-利用fis压缩项目
  9. Session小案例------完成用户登录
  10. SpannableString富文本
  11. ES6 二进制数组
  12. 03 CheckBox 复选框
  13. google cache源码详解
  14. 一款Android图文识别与扫描软件
  15. Alpha冲刺(5/10)——2019.4.27
  16. asp.net core mvc上传大文件解决方案
  17. JAVA验证身份证格式及合法性
  18. SQLSERVER 中sp_who, sp_who2和sp_who3(转载)
  19. about Version Control(版本控制)
  20. Oracle VM VirtualBox CentOS7桥接设置问题解决

热门文章

  1. linux驱动路径
  2. 从零开始学ios开发(六):IOS控件(3),Segmented Control、Switch
  3. iPad横屏模式研究
  4. Linq to XML 之XElement的Descendants方法的新发现
  5. UML 小结(6)- UML九种图的比较与学习
  6. [搜片神器]使用C#实现DHT磁力搜索的BT种子后端管理程序+数据库设计(开源)
  7. 生成最小树prim算法
  8. 虚拟机备份转移后,网络启动异常,提示“SIOCSIFADDR: No such device”的解决方案
  9. sql查询结果本身要被使用两次
  10. NYOJ-32 组合数 AC 分类: NYOJ 2014-01-02 22:21 112人阅读 评论(0) 收藏