remy boys
remy boys

Reputation: 2958

TabBar's background color gets change on tab selection

I don't know why this is happening, I checked it on my storyboard, for my code, I've searched similar questions but didn't find anything.

In my tabBar I have 4 tabs, when I selecting tab #2 tabBars background color gets darken but when I select any other tab it works fine. See the image for better understanding.

tab1 selected enter image description here

tab2 selected (and the background color also get changed

enter image description here tab3 selected , and now background color gets normal

enter image description here

Upvotes: 1

Views: 695

Answers (1)

Mudith Chathuranga Silva
Mudith Chathuranga Silva

Reputation: 7444

I think that you are setting tab bar color when presenting 2nd Tab. So remove the background color in the second tab. If you can't still find that try to reset the color when view the tab :-

override func viewWillAppear(animated: Bool) {
    self.tabBarController?.tabBar.backgroundColor = UIColor.clearColor()
}

Upvotes: 0

Related Questions