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 navi
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]; } }}
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];
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!
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.
I was able to change the color of the Configure NavBar like this:
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];
}
}
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];
}