I have following code. If I change .background(Color.green)
to .background(Color.white)
for the VStack the background will be the systemGray I used for the Listbackground.
Has it something to do with the .colorMultiply(Color(UIColor.systemGray4))
property?.
var body: some View {
NavigationView {
List {
Text("Bla bla bla")
Group {
VStack {
TextField("Server address", text: $serverAddress)
.keyboardType(.default)
TextField("Server port", text: $serverPortString)
.keyboardType(.numberPad)
}
}
.padding()
.background(Color.green)
.cornerRadius(8)
// Some more elements
}
.navigationBarHidden(false)
.navigationBarTitle("Connect your Server", displayMode: .large)
}
.colorMultiply(Color(UIColor.systemGray4))
.onTapGesture {
self.hideKeyboard()
}
White background that get ignored:
Working green background: