设置导航栏中间的标题

self.navigationItem.title = @"title";

设置导航栏的主题颜色

self.navigationBar.barTintColor = [主题色];

设置导航栏的标题文字颜色

[self.navigationController.navigationBar setBarTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor grayColor]}];

设置背景颜色

[self.navigationBar setBarTintColor:[UIColor redColor]];

设置UIBarButtonItem的样式及图标颜色

UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(leftItemClick)];
        leftItem.tintColor=[UIColor grayColor];
    self.navigationItem.leftBarButtonItem = leftItem;

设置图片成为导航栏的标题

UIImageView* imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"marker"]];
    self.navigationItem.titleView = imageView;

设置后退按钮的文字,和样式;

/**
     UIBarButtonItemStylePlain,
     UIBarButtonItemStyleBordered NS_ENUM_DEPRECATED_IOS(2_0, 8_0, "Use UIBarButtonItemStylePlain when minimum deployment target is iOS7 or later"),
     UIBarButtonItemStyleDone,
     */

UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(backClick)];
    self.navigationItem.backBarButtonItem = backItem;

//点击Cell跳转控制器

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        UIViewController* VC = [[UIViewController alloc]init];
        [VC.view setFrame:[UIScreen mainScreen].bounds];
        VC.view.backgroundColor = [UIColor redColor];

//设置返回按钮的颜色

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

[self.navigationController pushViewController:VC animated:YES];
    }

//设置导航栏中title字体颜色及大小

UILabel *LB = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
    LB.text = @"ZCL";
    LB.font = [UIFont systemFontOfSize:8];
    LB.textColor = [UIColor redColor];
    //设置位置在中心
    LB.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = LB;

//自定义导航栏(搜索框)
    UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 50, 30)];
    searchBar.placeholder = @"输入科室进行查找";
    self.navigationItem.titleView = searchBar;

最新文章

  1. Linux Ubuntu12.04下安装OpenCv2.4.10
  2. MPAndroidChart 教程
  3. Linux 日常使用指令大全
  4. 防止 DDoS 攻击的五个「大招」!
  5. 百度地图API的自动定位和搜索功能(移动端)
  6. .Net IOC框架入门之一 Unity
  7. 为什么我不愿意用ECharts
  8. iot前台开发环境:搭建 SpringBoot+angularJs2
  9. flex调用JS报安全沙箱错误解决办法
  10. CentOS 显示历史执行过的命令以及用户历史命令缓存文件
  11. 8.8 正睿暑期集训营 Day5
  12. iOS获取真机沙盒文件、获取真机本地数据
  13. 【转载整理】Hibernater的锁机制
  14. Django框架(二) MTV模型简介
  15. 120. Triangle(动态规划 三角形最小路径 难 想)
  16. 【bzoj 2716】[Violet 3]天使玩偶 (CDQ+树状数组)
  17. linux IPC机制学习博客
  18. 2017年国内已经开设机器人工程专业(080803T)高校名单
  19. CentOS 开机自启动脚本
  20. Iosapp升级版本步骤

热门文章

  1. 适配器模式 & 装饰器模式
  2. 支持 XML 序列化的 Dictionary
  3. C++自带栈与队列_stack_queue_C++
  4. 厌倦了ListBox打印消息,使用RichTextBox试试吧
  5. 开车旅行(NOIP2012)
  6. 嵌入式Linux支持LCD console【转】
  7. Linux中断(interrupt)子系统之五:软件中断(softIRQ)【转】
  8. C3P0连接池工具类使用
  9. laravel按月/时间区间查询数据
  10. DotNetCore 笔记