Mika
Mika

Reputation: 1245

ios - change navigation bar tint color of 'More' tab

I have 7 tabs in my UITabBar. iOS automatically groups the last 2 tabs into a tab called 'More'. I have set the navigation bar tint color for the 7 tabs in viewDidLoad as follows:

 self.navigationController.navigationBar.tintColor = [UIColor blackColor];

How do I set the color of the navigation bar for the automatically generated 'More' tab?

Upvotes: 1

Views: 4038

Answers (6)

amit gupta
amit gupta

Reputation: 1167

for ios 8.0

 self.navigationController.navigationBar.barTintColor = [UIColor blackColor];

Upvotes: 0

Leon
Leon

Reputation: 3726

For iOS 7 You can change the colour of the navigation bar, set to non-translucent (yes by default) and change the colour of the navigation title by adding the following into the AppDelegate:

UINavigationController *moreController = _tabBarController.moreNavigationController;
moreController.navigationBar.barTintColor = [UIColor orangeColor];
moreController.navigationBar.translucent = NO;
moreController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};

Upvotes: 0

iEngineer
iEngineer

Reputation: 1319

You need to change the color of UINavigationController in AppDelegate.m

 UIColor *navBarColor = [UIColor blackColor];
 [[UINavigationBar appearance] setTintColor:navBarColor];  
 self.navigationController.navigationBar.tintColor = navBarColor;

Upvotes: 1

matt
matt

Reputation: 535222

You can access self.tabBarController.moreNavigationController to get the navigation controller that appears when the More tab bar item is tapped by the user. Now you can perform modifications and customizations. For example you can change the style of its navigation bar. Example:

UINavigationController* more = self.tabBarController.moreNavigationController;
more.navigationBar.barStyle = UIBarStyleBlack;

For more about how to customize what appears when the More tab bar item is tapped, see this section of my book:

http://www.apeth.com/iOSBook/ch25.html#_uitabbar

Upvotes: 4

landon beach
landon beach

Reputation: 337

Try apperance (probably in didfinishlaunchingwithoptions in the app delegate).

[[UITabBar appearance] setTintColor:[UIColor blackColor]];
[[UITabBarItem appearance] setTintColor:[UIColor blackColor]];    

Upvotes: 0

viral
viral

Reputation: 4208

self.navigationController.navigationBar.tintColor = [UIColor blackColor];

This line changes the tintColor for navigation bar.

From your question, It seems to me (and others, of course) that you have misunderstood UITabBarController as UINavigationController.

You can find all the information about customizing UITabBarController here

Upvotes: 1

Related Questions