Changing the background color of Tab Bar Changing the background color of Tab Bar ios ios

Changing the background color of Tab Bar


To change background colour of UITabBar

TabBarController* Tcontroller =(TabBarController*)self.window.rootViewController;Tcontroller.tabBar.barTintColor=[UIColor yourcolour];

Swift 3

Based on the code above, you can get it by doing this

let Tcontroller = self.window.rootViewController as? UITabBarControllerTcontroller?.tabBar.barTintColor = UIColor.black // your color

or in more general

UITabBar.appearance().barTintColor = UIColor.black // your color


We can also do it from Storyboard

1) Select the Tab Bar first:

enter image description here

2) Then from the Attribute Inspector choose Bar Tint colour as shown in the below image:

enter image description here

That's it!


swift 4

Inside your UITabBarController

tabBar.barTintColor = .purpletabBar.isTranslucent = false

You also have access to:

tabBar.tintColor = .greentabBar.unselectedItemTintColor = .blue

to change icon colours if you want.