SwiftUI contentShape 扩大onTapGest
2023-04-12 本文已影响0人
小白lf
Text("3456")
.frame(width: 250, height: 250, alignment: .center)
.contentShape(Circle()) // 扩大点击范围
.onTapGesture {
print("onTapGesture")
UIApplication.endEditing()
}