Can someone tell me how to add a gradient background on SwiftUI List?
Current code:
struct TestView: View {
var body: some View {
LinearGradient(gradient: Gradient(colors: [Color.red, Color.purple]), startPoint: .top, endPoint: .bottom)
.edgesIgnoringSafeArea(.vertical)
.overlay(
List {
Group {
Text("Hallo")
Text("World")
}
.background(Color.blue)
}
.background(Color.green)
.padding(50)
)
}
}
Current layout, where the gradient is visible behind the cells. I want to make the cells transparent to see the gradient underneath.
Thanks!
