Home > OS >  thin line on top of tab bar not removed in iOS 15
thin line on top of tab bar not removed in iOS 15

Time:11-18

Tried using below code in iOS 15, but the thin line on top of tabbar is not removed but below code works in iOS 13, iOS 14

let appearance = UITabBarAppearance()

appearance.shadowImage = nil

appearance.shadowColor = nil

appearance.backgroundEffect = nil

appearance.backgroundColor = UIColor.white

tabBar.standardAppearance = appearance

CodePudding user response:

You can try this

tabBar.standardAppearance.shadowColor = nil
tabBar.scrollEdgeAppearance.shadowColor = nil

CodePudding user response:

You need to apply this on tab bar class

  override func viewDidAppear(_ animated: Bool) {
    
    if #available(iOS 15.0, *) {

        let appearance = UITabBarAppearance()
        appearance.configureWithOpaqueBackground()
        appearance.backgroundColor = .white
        tabBar.standardAppearance = appearance
        tabBar.scrollEdgeAppearance = tabBar.standardAppearance

    }
    
}
  • Related