02-统一设置导航栏文字颜色

1、 统一设置设置返回按钮

 //返回按钮颜色
    UIImage *backButtonImage = [[UIImage imageNamed:@"navigator_btn_back"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 30, 0, 0)];
    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

2、设置状态栏颜色

 [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent];

3、 设置导航栏文字颜色

/**
*  设置导航栏上整体的文字颜色
*/
self.navigationBar.tintColor = [UIColor blackColor];

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

/**
* 只是设置导航栏上标题的文字颜色
*/
 self.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,[UIFont boldSystemFontOfSize:17.0],NSFontAttributeName ,nil];

5、统一设置导航栏背景颜色

/**
     * 统一设置导航栏的背景颜色
     */
  //设置导航栏颜色为:红色
    self.navigationBar.barTintColor = [UIColor redColor];

你可能感兴趣的:(02-统一设置导航栏文字颜色)