设置导航条的颜色

[self.navigationController.navigationBar setBackgroundColor:[UIColor colorWithPatternImage:kHelper_Image(@"titlebar")]];

    [self.navigationController.navigationBar setBackgroundImage:kHelper_Image(@"titlebar") forBarMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];

   

     设置TabBar的颜色

    [self.tabBarController.tabBar setBackgroundImage:kHelper_Image(@"titlebar")];

    [self.tabBarController.tabBar setTintColor:[UIColor whiteColor]];

   

     设置状态的的颜色

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];

    [self setNeedsStatusBarAppearanceUpdate];

   

     设置状态条的颜色

    UIImageView *bgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, -20, self.view.frame.size.width, 20)];

    bgView.backgroundColor = [UIColor colorWithPatternImage:kHelper_Image(@"titlebar")];

    [self.navigationController.navigationBar addSubview:bgView];

原文地址:https://www.cnblogs.com/zhaozhongpeng/p/4867913.html