As shown from the pictures below, using a navigationView in darkmode causes the safe areas of the screen to turn white. Is there a modifier that can help me fix this?
Here’s the code:
import SwiftUI
import SwiftData
struct ContentView: View {
@State var showTab = false
var body: some View {
NavigationView{
Button {
showTab = true
} label: {
Text("open tab")
}
}
.sheet(isPresented: $showTab){
SettingsView()
}
}
}
struct SettingsView: View {
var body: some View{
Text("hello")
}
}
#Preview {
ContentView()
.modelContainer(for: Item.self, inMemory: true)
}
It seemed only preview effect. In simulator tested it is fine. Change NavigationView to NaviagtionStack