3

I want to change item color in tabBar, not text the items not selected etc Longtime aim searching about it, I didn't find. I just found this code, it does not change item or image color, just text. The default color is grey, I want to change it.

This is the code I found:

UITabBar.appearance().barTintColor = UIColor(redRGB: 93, greenRGB: 175, blueRGB: 228)
UITabBar.appearance().tintColor = UIColor .redColor()
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:.Normal)
Marko Popovic
  • 3,999
  • 3
  • 22
  • 37
Osama Maki
  • 39
  • 3

1 Answers1

0

Try google for searching. No seriously try it.

For your problem. What is gray? UITabbaritems are standard grayed out in storyboard.

You can use

var image : UIImage? = UIImage(named:"myImage.png").imageWithRenderingMode(.AlwaysOriginal) 

The option Always original keeps the image as it is and it will not be grayed out.

For problems with that => Rendering always original problems

Community
  • 1
  • 1
SamuelD
  • 333
  • 2
  • 10