I am new to SwiftUI (like most people) and trying to figure out how to remove some whitespace above a List that I embedded in a NavigationView
In this image, you can
For me, I was applying the .navigationBarTitle
to the NavigationView
and not to List
was the culprit. This works for me on Xcode 11.2.1:
struct ContentView: View {
var body: some View {
NavigationView {
List {
NavigationLink(destination: DetailView()) {
Text("I'm a cell")
}
}.navigationBarTitle("Title", displayMode: .inline)
}
}
}