VStack {
Image(systemName: "person.circle").resizable().frame(width: 50, height: 50)
Spacer().frame(height: 50)
Text("Paul Hudson")
}
.onTapGesture {
print("Show details for user")
}
VStack {
Image(systemName: "person.circle").resizable().frame(width: 50, height: 50)
Spacer().frame(height: 50)
Text("Paul Hudson")
}
.contentShape(Rectangle()) // 추가
.onTapGesture {
print("Show details for user")
}
잘된다 contentShap을 좀 봐볼까.
hit testing을 위한 content shape을 정의
contentShape(_:eoFill:)
func contentShape<S>(_ shape: S, eoFill: Bool = false) -> some View where S : Shape