31

removed dead ImageShack link

As you can see the view I need to change is the provided view to customize the tabbar order. I want to change the color of the navigation bar (displaying "Konfigurieren" which means "Configure"), I already found out how to change the color of the "More"-Navigation Controller, but not this one. Can anybody help me with that?

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
gabtub
  • 1,460
  • 2
  • 18
  • 21
  • Yeah. I'd like to know that too. I've tried this for several days, but I couldn't get it to work.. – Jake Sep 10 '09 at 09:57
  • We can't see, really, since your image link seems to be broken. If you still have the original image, please reupload it to stack.imgur, or just edit your question to make it work without the image. Thanks. – Ilmari Karonen Jul 27 '15 at 14:44

8 Answers8

20

I think what you are looking for is this (to do when you create your navigation controller, typically in your app delegate):

UINavigationController *navigationController;
...
navigationController.navigationBar.tintColor = [UIColor blackColor];
Zoran Simic
  • 10,293
  • 6
  • 33
  • 35
15

Use int AppDelegate

tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor];
Saqib Saud
  • 2,799
  • 2
  • 27
  • 41
  • 8
    I don’t know why this answer was accepted: It only changes the tint color of the “More” tab’s navigation bar (which the question author said they already achieved) but not the one from the “Customize” modal view controller. user486217’s answer does the correct thing that was asked for. – Raphael Schweikert Apr 05 '11 at 12:02
14

Its Surely gonna work! :-)

self.navigationController.navigationBar.tintColor  = [UIColor blackColor];
DD_
  • 7,230
  • 11
  • 38
  • 59
Developer
  • 6,375
  • 12
  • 58
  • 92
12

Can be easier (use in tab bar delegate):

- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers {
id modalViewCtrl = [[[tabBarController view] subviews] objectAtIndex:1];  
if([modalViewCtrl isKindOfClass:NSClassFromString(@"UITabBarCustomizeView")] == YES)
    ((UINavigationBar*)[[modalViewCtrl subviews] objectAtIndex:0]).tintColor = [UIColor redColor];
}
Alex
  • 223
  • 2
  • 4
7

There is an easy way to change all the navigation bar styles instead of changing each one separately.

[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];

Just set this code in one of your initial views. With this, your more navigation controller and the configuration navigation controller (that appears after clicking "Edit" in more navigation controller) get a different style.

Like this you can change its color to a different one or change the background image.

Hope this helps.

fabioalmeida
  • 336
  • 4
  • 7
3

I was able to change the color of the Configure NavBar like this:

  1. Create a new class that inherits from UITabBarController.
  2. Implement this method:

    -(void)beginCustomizingTabBar:(id)sender
    {
        [super beginCustomizingTabBar:sender];
    
        // Get the new view inserted by the method called above
        id modalViewCtrl = [[[self view] subviews] objectAtIndex:1];
    
        if([modalViewCtrl isKindOfClass:NSClassFromString(@"UITabBarCustomizeView")] == YES)
        {
            UINavigationBar* navBar = [[modalViewCtrl subviews] objectAtIndex:0];
    
            [navBar setBarStyle:UIBarStyleBlackTranslucent];
            [navBar setTranslucent:YES];
        }
    }
    
takrl
  • 6,356
  • 3
  • 60
  • 69
2

Building off of the answer given by user486217, this may be even more defensively-coded:

id modalViewCtrl = [controller.view.subviews objectAtIndex:1];  
if([modalViewCtrl isKindOfClass:NSClassFromStrin(@"UITabBarCustomizeView")] == YES) {
    id navigationBar = [[modalViewCtrl subviews] objectAtIndex:0];
    if ([navigationBar isKindOfClass:[UINavigationBar class]]) {
        ((UINavigationBar*)navigationBar).tintColor = [UIColor redColor];
    }
}}
diadyne
  • 4,038
  • 36
  • 28
1

If you are looking for the standard colors (Gray, Black, White), you can set these values within xCode 5. Select the entire view controller, and select the attributes inspector. Under the attributes you will find a drop-down next to "Top Bar". There you can select various setting for color and opacity for the navigation bar controller.

Outlined below are a few screenshots. Hope this helps!

enter image description here

enter image description here

preynolds
  • 780
  • 8
  • 13