Is there way to disable the glass effect on a specific leftBarButtonItem UIBarButtonItem which has no action attached to it. It is just a non interactive image.

Asked on 2025-09-09

1 search

To disable the glass effect on a specific UIBarButtonItem that is a non-interactive image, you can follow the guidance provided in the WWDC sessions. While there isn't a direct mention of disabling the glass effect for a UIBarButtonItem, you can consider using a custom view for your bar button item. This approach allows you to have more control over the appearance and behavior of the item.

Here's a general approach based on the information from the sessions:

  1. Create a Custom View: Instead of using a standard UIBarButtonItem, create a custom view (e.g., a UIImageView) that displays your non-interactive image.

  2. Add the Custom View to the Navigation Bar: Use the custom view as the customView property of a UIBarButtonItem. This way, you can avoid the default glass effect applied to standard bar button items.

  3. Ensure No Interaction: Since the image is non-interactive, ensure that user interaction is disabled on the custom view by setting isUserInteractionEnabled to false.

This approach allows you to bypass the default styling and behavior of UIBarButtonItem and gives you full control over the appearance of your image.

For more detailed information on customizing navigation bars and toolbars, you can refer to the session Build a UIKit app with the new design (07:19).