13

I have a UITabBar with five icons, most of them being flat with just one color. However, one of these buttons should not have a tint color, since it's the company's logo and the logo has various different colors. I know it's possible to to so with UINavigationBar and UIToolbar (which is what I'm using and it's a horrible workaround).

I did some heavy searching and tried many different solutions (I came up with with some crazy ones too), but none of them seem to work for me o iOS 7. Does anyone have an idea of how to achieve that?

Thanks a million!

Viper
  • 1,408
  • 9
  • 13
Marcos Duarte
  • 3,472
  • 4
  • 19
  • 22
  • This might be useful http://stackoverflow.com/questions/675433/custom-colors-in-uitabbar – vishnuvarthan Jul 30 '14 at 08:42
  • The solution suggested on that thread doesn't solve my problem, although one of the answers is about doing what Kaszás suggested below. Anyway, thanks for helping – Marcos Duarte Jul 30 '14 at 11:02

2 Answers2

32

use ImageWithRenderingModeAlwaysOriginal.

UIImage *icon = [[UIImage imageNamed:@"yourImage"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
Dávid Kaszás
  • 1,877
  • 1
  • 16
  • 20
14

You can also create 'Image Asset' and set it there in the 'Attributes Inspector' tab.

enter image description here

Muhammed Tanriverdi
  • 3,230
  • 1
  • 23
  • 24