TabBar background color is changing even though I don't want it to

32 Views Asked by At

I want to change my tabbar background color. I did it in the AppDelegate.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    if #available(iOS 15.0, *) {
        let tabbar = UINavigationBar.appearance()
        tabbar.isTranslucent = false
        tabbar.barTintColor = UIColor(red: 0.42, green: 0.5, blue: 0.2, alpha: 1)
    }
    return true
}

But for some reason when I click on the CharactersTabBar button the tabbar's background changes. Is this something that cannot be changed or is it something customizable? If I can change my tabbar background color, how do I do that and why is this happening in my version? FYI, I did nothing in Main.storyboard. I will share screenshots.

enter image description here

enter image description here

0

There are 0 best solutions below