[SwiftUI] iOS15の場合、デフォルトでは、tableviewとnavigation barが透過されてしまう
ので、それを防ぐ
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// TabViewの背景色の設定
UITabBar.appearance().backgroundColor = UIColor.white
// NavigationBarの背景色の設定
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = UIColor.white
UINavigationBar.appearance().standardAppearance = appearance
if #available(iOS 15.0, *) {
UINavigationBar.appearance().scrollEdgeAppearance = appearance
}
return true
}