I would like to have a List
with an overlay that does not interfere with the tap reception in SwiftUI.
I have attempted to use an .overlay
as such;
struct TestView: View {
var body: some View {
List(0..<30){
Text("Item \($0)")
}.overlay(LinearGradient(gradient: Gradient(colors: [.purple, .clear]), startPoint: .bottom, endPoint: .center))
}
}
However, this results in the list not being scrollable (or if using NavigationLink
s, not clickable).
How can I have an overlay (or Z-Stack element for that matter) not receive any taps?