Search code examples
tabbarios15

iOS 15 tab bar transparent after scrolling to the bottom


How to fix iOS 15 tab bar transparent after scrolling to the bottom:

iOS 15 transparent tab bar


Solution

  • With iOS 15, Apple adds the scrollEdgeAppearance property for configuring the appearance of the tab bar while edge scrolling.

    https://developer.apple.com/documentation/uikit/uitabbar/3750912-scrolledgeappearance?changes=latest_minor

    scrollEdgeAppearance

    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
    }
    

    Result: iOS 15 not transparent tab bar