0

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

HangarRash
  • 7,314
  • 5
  • 5
  • 32
ahtctn
  • 15
  • 5
  • 2
    See [scrollEdgeAppearance](https://developer.apple.com/documentation/uikit/uitabbar/3750912-scrolledgeappearance) – HangarRash Aug 03 '23 at 17:05
  • [if #available(iOS 15.0, *) { let navigationBar = UINavigationBar() let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = Constants.tabbarBackgroundColor navigationBar.standardAppearance = appearance; navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance }] – ahtctn Aug 03 '23 at 17:07
  • 2
    Does this answer your question? [iOS 15 tab bar transparent after scrolling to the bottom](https://stackoverflow.com/questions/67899805/ios-15-tab-bar-transparent-after-scrolling-to-the-bottom) – HangarRash Aug 03 '23 at 17:08
  • 1
    that's it thank you very much man, i appreciate it :) – ahtctn Aug 03 '23 at 17:12

0 Answers0