I'm trying to give my ListView a background image which should not be for every cell. So only one image for the whole view.
I have tried to add .background(Image("nameOfImage))
as list modifier but did not do anything.
NavigationView {
List(elements) { element in
NavigationLink(destination: NextView) {
Text(element.name)
Image(element.image)
}
}.background(Image("nameOfImage"))
}
I have also tried a ZStack but I think the list overlays my image
So how can I put an image as list background or view background (the code above is the whole view)