Xcode13.0 iOS15适配

  1. 导航栏 tabBar透明
    放到控制器基类viewDidLoad方法
if #available(iOS 15.0, *) {
            let navAppearance = UINavigationBarAppearance()
            navAppearance.configureWithOpaqueBackground()
            navAppearance.backgroundColor = .white
            navAppearance.shadowColor = .clear
//            navAppearance.shadowImage = UIImage(color: .clear)
            navigationController?.navigationBar.scrollEdgeAppearance = navAppearance;
            
            let tabApperance = UITabBarAppearance()
            tabApperance.configureWithDefaultBackground()
            tabApperance.backgroundEffect = UIBlurEffect(style: .light)
            tabApperance.backgroundColor = .white
            tabApperance.shadowColor = .clear
//            tabApperance.shadowImage = UIImage(color: .clear)
            self.tabBarController?.tabBar.scrollEdgeAppearance = tabApperance
}

你可能感兴趣的:(Xcode13.0 iOS15适配)