- (void)setNav
{
UINavigationBar *bar = [UINavigationBar appearance];
//設置顯示的顏色
bar.barTintColor = [UIColor colorWithRed:62/255.0 green:173/255.0 blue:176/255.0 alpha:1.0];
//設置字體顏色
bar.tintColor = [UIColor whiteColor];
[bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
//或者用這個都行
// [bar setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor]}];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//*********
[self setNav];//修改程序中所有的顯示的navigationbar的顏色,字體
//********
}如圖