When I use SwiftUI to make my view,I can't make the tap event work. My Code like:
VStack{
HStack{
//SomeView...
}
.onTapGesture {
print("HStack Tap Work")
}
}
.onTapGesture {
print("VStack Tap Work")
}
And I just want to print "VStack Tap Work" when i tap the other area of VStack expect the HStack,and print "HStack Tap Work" when i tap the HStack.
But it always print "VStack Tap Work".So how can i resolve it?