How to fix iOS 15 tab bar transparent after scrolling to the bottom:
4 Answers
In iOS 15, UIKit has extended the usage of the scrollEdgeAppearance, which by default produces a transparent background.
Since I changed the tab bar color globally in my app, prior to iOS 15, I have added the following code to my AppDelegate:
UITabBar.appearance().barTintColor = "YOUR UITABBAR COLOR"
UITabBar.appearance().tintColor = "YOUR ICONS COLOR"
UITabBar.appearance().isTranslucent = true
To restore the old look, I had adopt the new UITBar appearance APIs, UITabBarAppearance. I changed my code to:
UITabBar.appearance().barTintColor = "YOUR UITABBAR COLOR"
UITabBar.appearance().tintColor = "YOUR ICONS COLOR"
UITabBar.appearance().isTranslucent = true
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = "YOUR UITABBAR COLOR"
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = UITabBar.appearance().standardAppearance
}

- 1,680
- 1
- 25
- 28
-
1THANK YOU SO MUCH! this helped! I was getting a transparent tab bar without this fix. – Artur Marchetto Oct 06 '21 at 13:11
-
Glad That helped. – GIJoeCodes Nov 04 '21 at 13:07
With iOS 15, Apple adds the scrollEdgeAppearance
property for configuring the appearance of the tab bar while edge scrolling.
To fix the transparent tab bar, you should create a custom scroll edge appearance and set it to the tab bar.
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.backgroundEffect = UIBlurEffect(style: .light)
tabBar.scrollEdgeAppearance = appearance
}

- 4,313
- 1
- 17
- 25
init() {
if #available(iOS 15, *) {
let tabBarAppearance: UITabBarAppearance = UITabBarAppearance()
tabBarAppearance.configureWithOpaqueBackground()
UITabBar.appearance().standardAppearance = tabBarAppearance
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
}
}

- 479
- 1
- 7
- 17
As explained by others, you have to enable and setup scrollEdgeAppearance
property.
Here is how to do it on storyboard
:
it will add an entire section of scroll edge appearance properties:

- 12,254
- 4
- 46
- 66