I have a set up like this:
NavigationStack {
List {
ForEach(allProjects) { project in
Section {
NavigationLink(destination: ProjectView()) {
ProjectRow(project: project)
}
}
}
}
}
This gives me the following result
While this is fine, I want to add some padding between the list and the navigation bar title so add some padding to the top of the list with .padding(.top, 8)
and this gives me a strange result:
While it does give me additional padding, it makes the whole navigation bar white for some reason.
I also tried putting the List inside a Vstack and adding the padding to the Vstack, but it gives me the same result.
Any idea why this happens and how can I get padding to the navigation title when using a List ?