导航栏 UITabBarController等颜色的区别

//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:@"[email protected]"] 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)];导航控制器创建完导航按钮后,改变他的颜色的。

时间: 2024-08-28 02:03:18

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

设置导航栏的背景颜色的分类

 这是设置导航栏的背景颜色的分类

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

Android 修改底部导航栏navigationbar的颜色 getWindow().setNavigationBarColor(Color.BLUE); //写法一 getWindow().setNavigationBarColor(getResources().getColor(R.color.black_12));//写法二

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

我想设置Navigation Bar的背景颜色为黑色,然后所有内部颜色为白色. 因此,我用了这段代码: 1 [[UINavigationBar appearance] setTitleTextAttributes: 2 [NSDictionary dictionaryWithObjectsAndKeys: 3 [UIColor whiteColor], 4 NSForegroundColorAttributeName, 5 [UIColor whiteColor], 6 NSForeground

仿微信主界面导航栏图标字体颜色的变化

在所有的移动产品中,微信的界面做的很简洁,简单,我对微信主界面影响最深的就是微信底部导航栏的图标,以及字体颜色的变化,一直都想实现以下,今天有空,就大体的模仿者做了一遍. 效果图如下: 分析: 底部主要分为图标的渐变,字体颜色的渐变. 图标的颜色的渐变:主要是通过canvas绘制两个不同的图片,控制其图片的alpha透明度,来达到图标的渐变. 字体颜色:字体颜色就很好说了,Animator动画框架应该很熟悉了,在Animator框架中,有一个TypeEven是来计算十六进制色值的,我们可以通过A

统一设置导航栏的皮肤颜色

+ (void)initialize{ UINavigationBar *bar = [UINavigationBar appearance]; //    [self buttonImageFromColor:[UIColor blackColor]] UIImage *image = [UIImage imageNamed:@"img_nav_topbar"]; [bar setBackgroundImage:image forBarMetrics:UIBarMetricsDefa

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

首先,层级关系: leftBarButtonItem.rightBarButtonItem.title都是加在UINavigationItem上的,UINavigationItem再加在NavigationBar上,NavigationBar对应唯一的NavigationController. 1. 设置导航栏NavigationBar的背景颜色: 在appdelegate里创建UINavigationController后 设置 (1.) setBarTintColor : 设置Nagivat

去掉导航栏分割线 和 设置导航栏的背景颜色

iOS7之后由于navigationBar.translucent默认是YES,坐标零点默认在(0,0)点 当不透明的时候navigationBar.translucent=no,零点坐标在(0,64): - (void)setNavigationBar { self.automaticallyAdjustsScrollViewInsets = NO; self.edgesForExtendedLayout = UIRectEdgeTop; // 顶部开始 self.navigationCont

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

如果是storyboard 直接embed一个导航栏,然后在新出现的导航栏 选属性 选一下颜色就可以了 代码实现背景颜色修改:self.navigationController.navigationBar.barTintColor = [UIColor blueColor]; 代码实现背景图片修改:当然在属性里面也是可以添加修改的[self.navigationController.navigationBar setBackgroundImage: [UIImage imageNamed:@"b

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

override func viewDidLoad() { super.viewDidLoad() if let imageView = self.findNavLineView(view: navigationBar) { // 在分隔线上添加一个跟分隔线大小一模一样的View, 然后修改颜色即可 let navBarLineView = UIView() navBarLineView.frame = imageView.bounds navBarLineView.backgroundColo