I had problems getting this to work and I haven’t seen a working example anywhere on the Internet. Now I offer generosity on this, as it makes me crazy. It should be easy, but it doesn't seem to be.
I would like my buttons on my UINavigationBar to be translucent so that they display the background of what is on the UINavigationBar to show. This effect manifests itself in many applications below. You can do this by setting a custom background on an element, which I think is an unacceptable solution, because it requires you to prepare images in advance, and they will not be adapted for variable buttons, etc. They will not look like the Apple user interface and I do not believe that there is a reason for this: UIKit already draws a background for these buttons, we just need to change it. The correct solution uses bar elements and views created by Apple apis.
UIBarButtonItem is not a subclass of UIView. When you create it and add it to the UINavigationBar, some code somewhere in the structure draws a view for it. Framework methods seem to resist anything related to ensuring the transparency of bar elements, such as the tintColor property.
For example, this does NOT work:
UINavigationItem *item = [[UINavigationItem alloc] init]; UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithTitle:@"SUCKS" style:UIBarButtonItemStyleBordered target:self action:@selector(whatever:)]; editButton.tintColor = [UIColor colorWithWhite:0.4 alpha:0.3]; item.leftBarButtonItem = editButton;
None of this will make the UINavigationBar allow translucency for its bar elements. I believe that at runtime we should:
- Get image for panel item
- Mask for transparency
- Set a new image in the panel
But I was not able to get the image at runtime or disguise it properly. How do you do this?

source share