What: add space between the list inside a Navigation Stack and the toolbar on top.
Current code is like this
struct ContentView: View {
let words = ["Hello", "World", "SwiftUI", "OpenAI", "ChatGPT"]
var body: some View {
NavigationStack {
List(words, id: \.self) { word in
NavigationLink(destination: AnotherView()) {
Text(word)
}
}
.padding(.top, 50)
.listStyle(.insetGrouped)
.listRowInsets(EdgeInsets())
.navigationTitle("Words")
.toolbarBackground(.yellow, for: .navigationBar)
.toolbarBackground(.visible, for: .navigationBar)
.toolbar {
Text("something")
}
}
}
}
It creates space in this white background.
How I can have space but match the background color the same as what the screen has.