Reputation: 239
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
Reputation: 2916
It seems that on iOS 15 this is working to remove the shadow line
tabBar.standardAppearance.configureWithTransparentBackground()
tabBar.clipsToBounds = true
Upvotes: 2
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
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