// // NavigationController.m // TCXF // // Created by 张毅成 on 2017/6/22. // Copyright © 2017年 张毅成. All rights reserved. // #import "NavigationController.h" @interface NavigationController () @end @implementation NavigationController - (void)viewDidLoad { [super viewDidLoad]; } + (void)load { //设置导航条的样式 UINavigationBar *navBar = [UINavigationBar appearance]; // 取出导航条item的外观对象(主题对象) // navBar.barTintColor = basicColorDark; [navBar setBackgroundImage:[UIImage imageWithBgColor:[UIColor whiteColor] alpha:1.0] forBarMetrics:UIBarMetricsDefault]; // [navBar setShadowImage:[UIImage new]]; [navBar setShadowImage:[UIImage imageWithColor:[UIColor whiteColor]]]; [navBar setTitleTextAttributes: @{NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[UIColor blackColor]}]; navBar.tintColor = [UIColor blackColor]; UIBarButtonItem *item = [UIBarButtonItem appearance]; // 设置默认状态文字的颜色 NSMutableDictionary *md = [NSMutableDictionary dictionary]; md[NSForegroundColorAttributeName] = [UIColor whiteColor]; md[NSFontAttributeName] = [UIFont systemFontOfSize:16]; [item setTitleTextAttributes:md forState:UIControlStateNormal]; // 设置高亮状态文字的颜色 NSMutableDictionary *higMd = [NSMutableDictionary dictionary]; higMd[NSForegroundColorAttributeName] = [UIColor whiteColor]; higMd[NSFontAttributeName] = [UIFont systemFontOfSize:16]; [item setTitleTextAttributes:higMd forState:UIControlStateHighlighted]; // 设置不可用状态的颜色 NSMutableDictionary *disMd = [NSMutableDictionary dictionary]; disMd[NSForegroundColorAttributeName] = [UIColor whiteColor]; disMd[NSFontAttributeName] = [UIFont systemFontOfSize:16]; [item setTitleTextAttributes:disMd forState:UIControlStateDisabled]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end