[iOS15 대응] NavigationBar/Tabbar background color Transparent 이슈 해결
iOS

[iOS15 대응] NavigationBar/Tabbar background color Transparent 이슈 해결

iOS15로 넘어오면서.,,, 네비게이션바나 탭바가 있는 뷰에서 화면 전환을 때리면 배경이 투명해지고 border line이 사라지도록 변경되었다. 사실 이슈는 아닌ㄷㅔ;; 내 생각대로 안 되면 이슈임. ㅇㅇ

관련 포럼: https://developer.apple.com/forums/thread/682420

 

barTintColor not working in iOS 15 | Apple Developer Forums

In iOS 15, UIKit has extended the usage of the scrollEdgeAppearance, which by default produces a transparent background, to all navigation bars. The background is controlled by when your scroll view scrolls content behind the navigation bar. Your screensho

developer.apple.com

왼쪽 사진에서 오른쪽 사진 뷰로 이동한 건데,, 있었는데 없어졌어요!

첨엔 버그인 줄 알고 탭바 적용된 기본앱 찾아보니까 다 이렇게 변경되었더라,,

 

해결 참고 코드 : https://stackoverflow.com/questions/69111478/ios-15-navigation-bar-transparent

 

iOS 15 Navigation Bar Transparent

My iOS app uses the storyboard for the UI and uses a custom tint for the background color of the navigation bar. I have tested my app on the Xcode 13 beta 5 and the navigation bar is "white&qu...

stackoverflow.com

 

 

해결 참고 코드 위 링크에서는 네비게이션 바 대응이었고, 나는 아래 코드로 Tabbar에서 대응 완료~! 아~~~~ 스택오버플로우 짱~!

if #available(iOS 15, *) {
            let appearance = UITabBarAppearance()
            let tabBar = UITabBar()
            appearance.configureWithOpaqueBackground()
            appearance.backgroundColor = UIColor(named: "당신의색깔을넣으셈요")!
            tabBar.standardAppearance = appearance;
            UITabBar.appearance().scrollEdgeAppearance = appearance
        }

 

위 코드를 AppDelegate.Swift 내

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool  함수에 넣으면 된다~~~ 아 물론 return 위에 아무데나~~~