//tint color是设置你选中的那个tabBar的颜色,默认是蓝色,点击是设置的红色
    vc.tabBar.tintColor = [UIColor redColor];
   
    //bar tint color
    vc.tabBar.barTintColor = [UIColor orangeColor];//背景的颜色

点击home键就是红色,背景颜色的橘色就是barTintColor

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma mark    ------------------------VC2
    
    ViewController2 *vc2 = [[ViewController2 alloc] init];  //设置视图控制器
    
    vc2.title = @"通讯录";
    
    vc2.view.backgroundColor = [UIColor grayColor];
    
    vc2.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"通讯录" image:[UIImage imageNamed:@"tabbar_contactsHL@2x"] tag:2];
    
    //创建导航控制器
    UINavigationController *nvc2 = [[UINavigationController alloc]initWithRootViewController:vc2];
    
    nvc2.navigationBar.tintColor = [UIColor redColor];
    
    nvc2.navigationBar.barStyle = UIBarStyleBlack;//背景是黑色
    
    nvc2.navigationBar.translucent = NO;

.m中

self.navigationItem.rightBarButtonItem.tintColor = [UIColor greenColor];

vc2.title = @"通讯录1";是最上边中间显示的那个白色

vc2.view.backgroundColor = [UIColor grayColor];  这个视图的背景是gray颜色

vc.tabBar.barTintColor = [UIColor orangeColor];//背景的颜色  是设置那个橘色

这个分栏控制器的名称是“通讯录”

UINavigationController *nvc2 = [[UINavigationController alloc]initWithRootViewController:vc2];创建导航控制器

取自于分栏目控制器vc2,

nvc2.navigationBar.tintColor = [UIColor redColor];  设置导航控制器上边字体的颜色,上边的《《通讯录颜色就是红色,而

那个绿色的图标是因为在.m文件中    self.navigationItem.rightBarButtonItem.tintColor = [UIColor greenColor];,是在self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(onNext)];导航控制器创建完导航按钮后,改变他的颜色的。

导航栏 UITabBarController等颜色的区别的更多相关文章

  1. Android 修改底部导航栏navigationbar的颜色

    Android 修改底部导航栏navigationbar的颜色 getWindow().setNavigationBarColor(Color.BLUE); //写法一 getWindow().set ...

  2. iOS 8 设置导航栏的背景颜色和背景图片

    假设是storyboard 直接embed一个导航栏.然后在新出现的导航栏 选属性 选一下颜色就能够了 代码实现背景颜色改动:self.navigationController.navigationB ...

  3. iOS导航栏NavigationBar的颜色,按钮和标题以及字体颜色

    首先,层级关系: leftBarButtonItem.rightBarButtonItem.title都是加在UINavigationItem上的,UINavigationItem再加在Navigat ...

  4. iOS史上最简单修改导航栏分隔线颜色方法!!!

    override func viewDidLoad() { super.viewDidLoad() if let imageView = self.findNavLineView(view: navi ...

  5. 【Android开发】通过 style 设置状态栏,导航栏等的颜色

    <style name="test"> <!--状态栏颜色--> <item name="colorPrimaryDark"> ...

  6. ios怎么让状态栏颜色和导航栏背景图片颜色一样

    ios7 图片作为导航的背景的话,如果想实现状态栏和导航栏一体化,那么图片高度需要增加22,也就是64,retina是128

  7. iOS导航栏的背景颜色设置

    方法一: (1) self.navigationController.navigationBar.barStyle = UIBarStyleDefault; self.navigationContro ...

  8. Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色

    自从IOS7后UINavigationBar的一些属性的行为发生了变化.你可以在下图看到: 现在,如果你要修改它们的颜色,用下面的代码: self.navigationController.navig ...

  9. IOS7修改Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色

    解决方法 1: 自从IOS7后UINavigationBar的一些属性的行为发生了变化.你可以在下图看到: 现在,如果你要修改它们的颜色,用下面的代码: 1 2 3 4 self.navigation ...

随机推荐

  1. linux C(hello world)最大公约数和最小公倍数

    # include <stdio.h> int main(void) { int x, y,temp; int r; printf("请输入两个正整数:\n"); sc ...

  2. ecmall二次开发 直接实例化mysql对象

    $db = &db(); // 第一步赋值数据库类库, $db->query(sql); // 第二步执行mysql 语句; 常用的数据库函数: 得到一行数据 $user=$db-> ...

  3. Android-Chat-Widget

    Original: https://github.com/ijarobot/Android-Chat-Widget Backup: https://github.com/eltld/Android-C ...

  4. Android上的SQLLite性能分析

    也许有人还不知道,Android 是有一些内建的 类库支持 SQL Lite 数据库的操作.他提供了一个很好的方式在 Android 上组织少量的数据.不管怎样,在使用这些类库的时候有一些陷阱是需要注 ...

  5. 【JavaScript】HTML5存储方案

    1.Web SQL 2.IndexedDB 3.Local Storage 4.Session Storage 5.Cookies 6.Application Cache

  6. 第12届北师大校赛热身赛第二场 C. 组合数

    题目链接:http://www.bnuoj.com/bnuoj/contest_show.php?cid=3570#problem/43573 C. 组合数 Time Limit: 1000ms Ca ...

  7. linux下网络编程常见问题

    网络程序异常退出无core文件产生 这种情况发生在一边连接端已经关闭,但是另外一边还在对连接句柄做send操作,这样做send操作的进程会收到SIGPIPE信号,默认行为是直接退出且不会产生core. ...

  8. Ubuntu目录

    1. java.io.FileNotFoundException: ***(Too many open files) 2. 在Ubuntu 12.04 桌面上设置启动器(快捷方式) 3. 解决Ubun ...

  9. highcharts笔记 highcharts学习 highcharts用法

    标示线:plotLines : 绘制线:

  10. 关于Spring IOC容器解释

    何谓控制反转(IoC = Inversion of Control),何谓依赖注入(DI = Dependency Injection)?之前看到过两个比喻,觉得比较形象,特在此写下: IoC,用白话 ...