We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如上图,怎么让只点击红色背景时才关闭弹出菜单,现在是点击菜单边缘也会关闭 ` if commonData.isPopupMenuShow{ VStack(alignment:.trailing, spacing:0){ HStack{ Spacer() topArrow .offset(x: -16, y: 0)
} VStack(alignment: .center, spacing: 10){ Button("按钮1"){ } Button("按钮2"){ } Button("按钮3"){ } } .padding(.horizontal,10) .padding(.vertical,15) .frame(width: 100) .background("#333333".toColor()) .foregroundColor(Color.white) .cornerRadius(10) Spacer() } .background(Color.init(.sRGB, red: 0.8, green: 0.1, blue: 0.1, opacity: 0.5)) .offset(x:-5,y: 0) .zIndex(2) .onTapGesture { commonData.isPopupMenuShow = false } }
`
The text was updated successfully, but these errors were encountered:
找到了一个不合适的方法解决了此问题,在黑色的弹出菜单上添加onTapGesture { }就可以了
Sorry, something went wrong.
No branches or pull requests
如上图,怎么让只点击红色背景时才关闭弹出菜单,现在是点击菜单边缘也会关闭
`
if commonData.isPopupMenuShow{
VStack(alignment:.trailing, spacing:0){
HStack{
Spacer()
topArrow
.offset(x: -16, y: 0)
`
The text was updated successfully, but these errors were encountered: