I think the reason this happens is covered by these answers to another question:
fooobar.com/questions/743391 / ...
fooobar.com/questions/743391 / ...
UIBarButtonItems behave differently depending on where you attach them programmatically. If you attach them to the toolbar, they will become white “embossed” icons. If you attach them to the navigation bar, they will not.
I spent the last few hours writing a function to apply the toolbar UIBarButtonItem style to UIImages. It is written in C # for MonoTouch , but I'm sure you can configure it on Obj-C without any problems ...
UIImage ApplyToolbarButtonStyling(UIImage oldImage) { float shadowOffset = 1f; float shadowOpacity = .54f; RectangleF imageRect = new RectangleF(PointF.Empty, oldImage.Size); RectangleF shadowRect = new RectangleF(new PointF(0, shadowOffset), oldImage.Size); RectangleF newRect = RectangleF.Union(imageRect, shadowRect); UIGraphics.BeginImageContextWithOptions(newRect.Size, false, oldImage.CurrentScale); CGContext ctxt = UIGraphics.GetCurrentContext(); ctxt.ScaleCTM(1f, -1f); ctxt.TranslateCTM(0, -newRect.Size.Height); ctxt.SaveState(); ctxt.ClipToMask(shadowRect, oldImage.CGImage); ctxt.SetFillColor(UIColor.FromWhiteAlpha(0f, shadowOpacity).CGColor); ctxt.FillRect(shadowRect); ctxt.RestoreState(); ctxt.ClipToMask(imageRect, oldImage.CGImage); ctxt.SetFillColor(UIColor.FromWhiteAlpha(1f, 1f).CGColor); ctxt.FillRect(imageRect); UIImage newImage = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); return newImage; }
So, UIBarButtonItem, which looked like this:
Created using the function above, for example:
UIBarButtonItem barButtonItem = new UIBarButtonItem(ApplyToolbarButtonStyling(UIImage.FromFile("MusicIcon.png")), UIBarButtonItemStyle.Plain, delegate {});
Now it will look like this:
Hope this helps someone in the future.