iosswiftuibuttonios26uibarbuttonitemstyle

iOS 26 prominent button with glass effect results in button image barely visible


I have an iOS 26 app in which I have defined the app wide tintColor to be green:

UIView.appearance().tintColor = UIColor.systemGreen

I have a done button in my navigation bar whose style is .prominent:

let style: UIBarButtonItem.Style = if #available(iOS 26.0, *) { .prominent } else { .done }
navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "checkmark"), style: style, target: self, action: #selector(done))

This is causing it to look like this:

enter image description here

As you can see, the checkmark is barely visible in the button resulting in poor UX.

What's the proper way of tinting the button and the image in iOS 26?


Solution

  • This seems to be more noticeable depending on the tint color. Use .systemBlue or .systemRed and the checkmark doesn't appear as faded.

    One simple workaround to make the checkmark look better with the green tint is to force the checkmark image to be white.

    Instead of UIImage(systemName: "checkmark"), use:

    UIImage(systemName: "checkmark")?.withTintColor(.white, renderingMode: .alwaysOriginal)
    

    Of course you can tint the checkmark image to any color you want.

    The following shows the difference. The one on the left is from your code, the one on the right is after tinting the image white:

    enter image description here