相关疑难解决方法(0)

Clipped Image 在框架外调用 TapAction

我有一个关于图像上的 tapAction 的问题。在不应发生的剪切区域上调用 TapAction 闭包。我该怎么办?

Image(uiImage: image)
    .resizable()
    .aspectRatio(contentMode: .fill)
    .frame(height: 200, alignment: .center)
    .presentation(tapped ? Modal(Image(uiImage: image)) : nil)
    .clipped()
    .cornerRadius(10)
    .border(Color.black, width: 2, cornerRadius: 10)
    .tapAction {
        self.tapped.toggle()
    }
Run Code Online (Sandbox Code Playgroud)

结果是这样的:

在此处输入图片说明

image swift swiftui

7
推荐指数
1
解决办法
528
查看次数

标签 统计

image ×1

swift ×1

swiftui ×1