user2552751
user2552751

Reputation: 239

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

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

Upvotes: 2

Views: 1470

Answers (3)

TomCobo
TomCobo

Reputation: 2916

It seems that on iOS 15 this is working to remove the shadow line

tabBar.standardAppearance.configureWithTransparentBackground()
tabBar.clipsToBounds = true

Upvotes: 2

IluSioN
IluSioN

Reputation: 951

You can try this

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

Example in viewDidLoad :

override func viewDidLoad() {
    super.viewDidLoad()
    //...
    
    self.navigationController?.navigationBar.standardAppearance.shadowColor = nil
    self.navigationController?.navigationBar.scrollEdgeAppearance?.shadowColor = nil
}

Upvotes: 1

alex
alex

Reputation: 1

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

    }
    
}

Upvotes: 0

Related Questions