Close Menu
geekfence.comgeekfence.com
    What's Hot

    Senior Member Solves Product Lifecycle Challenges

    June 27, 2026

    Agentic Code Review – O’Reilly

    June 27, 2026

    How Precisely and DoorDash Are Rethinking Delivery of AI-Ready Commercial Property Imagery

    June 27, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»iOS Development»uitabbarcontroller – UITabBar unselectedItemTintColor ignored iOS 26
    iOS Development

    uitabbarcontroller – UITabBar unselectedItemTintColor ignored iOS 26

    AdminBy AdminJune 27, 2026No Comments3 Mins Read0 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    uitabbarcontroller – UITabBar unselectedItemTintColor ignored iOS 26
    Share
    Facebook Twitter LinkedIn Pinterest Email


    I’m creating a UITabBarController programmatically with a few tabs, but for some reason I can not get the normal state of the tabs icons or text to change color. Its defaulting to a system white. I can only modify the selected state.

    I’ve tried creating the tabs in multiple ways, but all seem to return the same result. The only thing I’ve managed to work around is by forcing the icons (which are templates) to render as originals after tinting them. This only works for the icons, leaving the text in the system white color, so i’ve disabled it as it looks worse to have one of each

    private func configureTabs() {
        let inbox = InboxViewController()
        inbox.tabBarItem = UITabBarItem(
            title: "INBOX",
            //image: UIImage(named: "tab-inbox")?.withTintColor(AppColors.t3, renderingMode: .alwaysOriginal),
            //selectedImage: UIImage(named: "tab-inbox")?.withTintColor(AppColors.t1, renderingMode: .alwaysOriginal)
            image: UIImage(named: "tab-inbox"),
            selectedImage: UIImage(named: "tab-inbox")
        )
            
        let capture = CaptureViewController()
        capture.tabBarItem = UITabBarItem(
            title: "CAPTURE",
            //image: UIImage(named: "tab-inbox")?.withTintColor(AppColors.t3, renderingMode: .alwaysOriginal),
            //selectedImage: UIImage(named: "tab-inbox")?.withTintColor(AppColors.t1, renderingMode: .alwaysOriginal)
            image: UIImage(named: "tab-capture"),
            selectedImage: UIImage(named: "tab-capture")
        )
            
        tabBar.tintColor = AppColors.t1
        tabBar.unselectedItemTintColor = AppColors.t3
            
        viewControllers = [
            inbox,
            capture
        ]
    }
    

    I’ve also tried setting the Appearance proxy in 2 different ways, with many variations of settings in each:

    private func configureAppearance() {
        // NavBar
        let navAppearance = UINavigationBarAppearance()
        navAppearance.configureWithDefaultBackground()
        navAppearance.backgroundColor = AppColors.bg
        navAppearance.shadowColor = AppColors.border
        navigationController?.navigationBar.standardAppearance = navAppearance
        navigationController?.navigationBar.scrollEdgeAppearance = navAppearance
        navigationController?.navigationBar.tintColor = AppColors.t1
            
        // TabBar
        let normalColor = AppColors.t3
        let selectedColor = AppColors.t1
            
        let normalFont = UIFont(name: UIFont.JetBrainsMono.regular, size: 10) as Any
        let selectedFont = UIFont(name: UIFont.JetBrainsMono.regular_semiBold, size: 10) as Any
            
        let normalTitleAttributes: [NSAttributedString.Key: Any] = [
            .font: normalFont,
            .foregroundColor: normalColor
        ]
        let selectedTitleAttributes: [NSAttributedString.Key: Any] = [
            .font: selectedFont,
            .foregroundColor: selectedColor
        ]
            
        let appearance = UITabBarAppearance()
        //appearance.configureWithOpaqueBackground()
            
        func configure(_ itemAppearance: UITabBarItemAppearance) {
            itemAppearance.normal.iconColor = normalColor
            itemAppearance.normal.titleTextAttributes = normalTitleAttributes
                
            itemAppearance.selected.iconColor = selectedColor
            itemAppearance.selected.titleTextAttributes = selectedTitleAttributes
            }
            
        configure(appearance.stackedLayoutAppearance)
        configure(appearance.inlineLayoutAppearance)
        configure(appearance.compactInlineLayoutAppearance)
            
        tabBar.standardAppearance = appearance
        tabBar.scrollEdgeAppearance = appearance
            
        tabBar.tintColor = selectedColor
        tabBar.unselectedItemTintColor = normalColor
    }
    

    and with a constraint:

    func setupAppearence() {
        let appearance = UITabBarItem.appearance(whenContainedInInstancesOf: [MainTabBarController.self])
        appearance.setTitleTextAttributes([
            NSAttributedString.Key.foregroundColor: AppColors.t3,
            //NSAttributedString.Key.font: UIFont.custom(ofType: .medium, andSize: 10)
        ], for: .normal)
        appearance.setTitleTextAttributes([
            NSAttributedString.Key.foregroundColor: AppColors.t1,
            //NSAttributedString.Key.font: UIFont.custom(ofType: .medium, andSize: 10)
        ], for: .selected)
            
        self.tabBar.shadowImage = nil
        self.tabBar.tintColor = AppColors.t1
        self.tabBar.unselectedItemTintColor = AppColors.t3
    }
    

    I can get the font family, size and weight to change, but not the color. I thought maybe my AppColors.t1 might have been incorrectly set somewhere, so I tweaked that value and only the selected state changed. So its not using my whiteish .t1 color as the normal state, its picking up a system color from somewhere, but I cant figure out where.

    Have I missed a property somewhere? is there a liquid glass mode I have to toggle on to allow different colors or something? What have I missed? AI has been no help



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    Responses Bug in LM Studio

    June 23, 2026

    ios – How to make headerView with overlapping content design in SwiftUI

    June 22, 2026

    Kits All the Way Down

    June 18, 2026

    ios – UITabBarController on iPadOS 18 swallows all touches even with mode = .tabBar (via Python/rubicon-objc)

    June 17, 2026

    ios – Centered ScrollView content doesn’t return to position after pull-to-refresh with a large navigation title in SwiftUI

    June 12, 2026

    Introducing SwiftBash | Cocoanetics

    June 8, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202556 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202630 Views

    Redefining AI efficiency with extreme compression

    March 25, 202628 Views
    Don't Miss

    Senior Member Solves Product Lifecycle Challenges

    June 27, 2026

    What do an instinct to fix things and the 1999 global panic over whether computers…

    Agentic Code Review – O’Reilly

    June 27, 2026

    How Precisely and DoorDash Are Rethinking Delivery of AI-Ready Commercial Property Imagery

    June 27, 2026

    Scattered Spider Hackers Plead Guilty on Day 1 of Trial – Krebs on Security

    June 27, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    Senior Member Solves Product Lifecycle Challenges

    June 27, 2026

    Agentic Code Review – O’Reilly

    June 27, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

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