UIBarButtonItem and Liquid Glass

I am looking for a way to change the liquid glass background colors on UIBarButtonItems. Setting tintColor does what I want for a bar button item when it is both the default button and it is enabled. But it does not seem to do anything for disabled buttons or non-prominent buttons.

Also, is there a way to apply such a change using a UINavigationBarAppearance or a UIBarButtonItemAppearance?

If I cannot change this liquid glass color, I might need to disable liquid glass on these by setting hidesSharedBackground to true. Is there a way to do this globally within the app (without using UIDesignRequiresCompatibility), or with something like UINavigationBarAppearance or UIBarButtonItemAppearance?

Thank you.

John

Thanks for the post.

Customizing the background color of UIBarButtonItems, especially with the liquid glass effect introduced in newer iOS versions, can be a bit tricky.

As you've noted, effects enabled and prominent buttons but doesn't impact disabled or less prominent ones. This is because the liquid glass effect heavily influences these states and appearances.

There is a good documentation about Liquid Glass that summarizes that less customization is better to let iOS show the controls in each version of iOS 26+

https://developer.apple.com/documentation/TechnologyOverviews/liquid-glass

Unfortunately, there isn’t a direct global API switch to apply to all UIBarButtonItems without subclassing or individual configuration that I know on top of my head. You could subclass UIBarButtonItem to create a custom button where you set or adjust appearances consistently across your app.

While complete customization of the liquid glass effect is limited, these approaches give you a reasonable degree of control over button appearances. Subclassing offers a straightforward way to enforce consistent styles without altering system-wide compatibility settings.

Albert Pascual
  Worldwide Developer Relations.

Thank you, Albert!

One more question: If I disable liquid glass on a UIBarButtonItem by setting hidesSharedBackground to true, the liquid glass effect disappears but the bar button titles are spaced differently from where they are when liquid glass is disabled globally in the app. I think the spacing difference is the framework allocating space as if the bar button title would be inset on a liquid glass background. Is there a good way to make the bar button item appear without adding this margin?

John

UIBarButtonItem and Liquid Glass
 
 
Q