Post

Replies

Boosts

Views

Activity

[SwiftUI] Gray view with simple navigation
Hi guys, I'm getting a weird navigation side effect (a half screen grey view) when moving from one view to another. Here's the code: @State var text: String = "" var body: some View { NavigationView { VStack { TextField("TextField", text: $text) NavigationLink { Text("Yellow view") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.yellow) Spacer() } label: { Text("Yellow view") } Spacer() } } Text("Bottom View") .frame(maxWidth: .infinity, maxHeight: 60) .background(Color.red) } } And here's what I'm seeing: Is there any way to fix it, without moving the red view inside the NavigationView hierarchy ?
7
0
2.2k
Oct ’21