Post

Replies

Boosts

Views

Activity

SwiftUI HitTesting cannot be disabled in ZStack
When using the following layout, the Rectangle still receives touch events stopping the underlying content or scroll view from receiving interaction. I believe this might be a SwiftUI bug? ZStack(alignment: .bottom) { Color.blue ScrollView { VStack(alignment: .leading) { Text("Text") Text("Text") Button() } } Rectangle()         .fill(LinearGradient(gradient: Gradient(colors: [Color.red, Color.red, .clear]), startPoint: .bottom, endPoint: .top))         .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 150) .allowsHitTesting(false) }
2
0
1.4k
Dec ’20