display original image color with UIBarButtonItem

Posted by user262325 on Stack Overflow See other posts from Stack Overflow or by user262325
Published on 2012-04-09T05:25:21Z Indexed on 2012/04/09 5:29 UTC
Read the original article Hit count: 147

Filed under:

I used codes below to display a image on an UIBarButtonItem

UIBarButtonItem *myButtonItem;
myButtonItem= [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"image.png"] style:UIBarButtonItemStylePlain target:self action:@selector(pressB:)];

but the image color is two colors(red/blue), but the image displayed on the ButtonItem is white.

Iy looks like IOS change it to white color automatically.

Welcome any comment

© Stack Overflow or respective owner

Related posts about iphone