Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    ios – SwiftUI: Zoom-navigation-transitions not working in tabViewBottomAccessory with a view model

    December 9, 2025

    Computational Approach Stabilizes Metallene for Nanotech

    December 9, 2025

    Sophos Firewall v22 is now available – Sophos News

    December 9, 2025
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»swift – iOS 26 UIButton prominentClearGlass icon color doesn’t adapt to the brightness/darkness of content behind it
    iOS Development

    swift – iOS 26 UIButton prominentClearGlass icon color doesn’t adapt to the brightness/darkness of content behind it

    big tee tech hubBy big tee tech hubDecember 2, 2025012 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    swift – iOS 26 UIButton prominentClearGlass icon color doesn’t adapt to the brightness/darkness of content behind it
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    In iOS 26, I need my UIButton to automatically adapt the icon color based on the content behind it. For example, if there is a scrolling table view behind it and the content becomes light, then the button icon should be black. If content is dark, then icon should be white. The iOS UITabBar icons already do this.

    How should I do this with UIButton of various styles: UIButton.Configuration.glass(), .clearGlass(), .prominentGlass(), .prominentClearGlass()?

    Below example shows the issue:

    import UIKit
    import SnapKit
    
    class ViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            
            view.backgroundColor = .lightGray
            
            let stackView = UIStackView()
            stackView.axis = .vertical
            stackView.spacing = 20
            view.addSubview(stackView)
            stackView.snp.makeConstraints { make in
                make.center.equalToSuperview()
            }
            
            let imageConfig = UIImage.SymbolConfiguration(pointSize: 22, weight: .bold, scale: .large)
            
            let padding = 20.0
            
            [UIButton.Configuration.glass(),.clearGlass(),.prominentGlass(),.prominentClearGlass()].forEach { config in
                
                let button = UIButton(type: .system)
                button.configuration = config
                button.setTitle(config.title, for: .normal)
                button.setImage(UIImage(systemName: "square.and.pencil", withConfiguration: imageConfig)?.withRenderingMode(.automatic), for: .normal)
                button.configuration?.contentInsets = NSDirectionalEdgeInsets(top: padding, leading: padding, bottom: padding, trailing: padding)
                stackView.addArrangedSubview(button)
                
            }
            
        }
    
    }
    

    Above produces:

    enter image description here

    And if I set the background color to pure white, it produces:

    enter image description here

    As you can see, the icon colours aren’t adapting for the content behind them and thus hard to read. How is able to archive this in their UITabBar icons?

    enter image description here

    enter image description here



    Source link

    adapt brightnessdarkness Color Content doesnt icon iOS prominentClearGlass Swift UIButton
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    ios – SwiftUI: Zoom-navigation-transitions not working in tabViewBottomAccessory with a view model

    December 9, 2025

    android – How to Optimize a Flutter application

    December 8, 2025

    How to Add Many iOS 26 Icon Themes with Icon Composer in SwiftUI?

    December 7, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    ios – SwiftUI: Zoom-navigation-transitions not working in tabViewBottomAccessory with a view model

    December 9, 2025

    Computational Approach Stabilizes Metallene for Nanotech

    December 9, 2025

    Sophos Firewall v22 is now available – Sophos News

    December 9, 2025

    The Real Magic of the Season: AI-Powered Workplaces

    December 9, 2025
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    ios – SwiftUI: Zoom-navigation-transitions not working in tabViewBottomAccessory with a view model

    December 9, 2025

    Computational Approach Stabilizes Metallene for Nanotech

    December 9, 2025

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2025 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.