Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Bar Item image displaying wrong color

I have a bar with Bar Items, my .png image has green color, but when i add it to storyboard it's displaying as blue.

How can i make it display the image as it is?

enter image description here

enter image description here

like image 923
Lord Vermillion Avatar asked Dec 07 '25 07:12

Lord Vermillion


1 Answers

Use tintColor of UIBarButton to set the desired color for the image. If its absolutely necessary to use original image colors, use this to set the image:

[aBarButton setImage:[[UIImage imageNamed:@"xyz.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
like image 52
Ishan Handa Avatar answered Dec 08 '25 21:12

Ishan Handa