Change tab bar tint color on iOS 7 Change tab bar tint color on iOS 7 ios ios

Change tab bar tint color on iOS 7


Try the below:

[[UITabBar appearance] setTintColor:[UIColor redColor]];[[UITabBar appearance] setBarTintColor:[UIColor yellowColor]];

To tint the non active buttons, put the below code in your VC's viewDidLoad:

UITabBarItem *tabBarItem = [yourTabBarController.tabBar.items objectAtIndex:0];UIImage *unselectedImage = [UIImage imageNamed:@"icon-unselected"];UIImage *selectedImage = [UIImage imageNamed:@"icon-selected"];[tabBarItem setImage: [unselectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];[tabBarItem setSelectedImage: selectedImage];

You need to do this for all the tabBarItems, and yes I know it is ugly and hope there will be cleaner way to do this.

Swift:

UITabBar.appearance().tintColor = UIColor.redtabBarItem.image = UIImage(named: "unselected")?.withRenderingMode(.alwaysOriginal)tabBarItem.selectedImage = UIImage(named: "selected")?.withRenderingMode(.alwaysOriginal)


There is an much easier way to do this.

Just open the file inspector and select a "global tint".

You can also set an app’s tint color in Interface Builder. The Global Tint menu in the Interface Builder Document section of the File inspector lets you open the Colors window or choose a specific color.

Also see:

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html


iOS 7.1.1

If someone is going to need to use globally setting tint color:

[[UIView appearance] setTintColor:[UIColor whiteColor]];

In didFinishLaunchingWithOptions of AppDelegate.

Also below code will change only tab bar tint color in any viewDidLoad method:

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