Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SwiftUI:将悬停效果添加到图像链接会强制双击以激活链接_Swiftui - Fatal编程技术网

SwiftUI:将悬停效果添加到图像链接会强制双击以激活链接

SwiftUI:将悬停效果添加到图像链接会强制双击以激活链接,swiftui,Swiftui,我使用以下代码创建仅包含图像(无文本)的链接并添加悬停效果: Link(destination: URL(string: webURL)!, label: { Image("Home", bundle: Bundle.module) .resizable() .renderingMode(.template) .frame(width: 30, height: 30) .as

我使用以下代码创建仅包含图像(无文本)的链接并添加悬停效果:

Link(destination: URL(string: webURL)!, label: {
   Image("Home", bundle: Bundle.module)
            .resizable()
            .renderingMode(.template)
            .frame(width: 30, height: 30)
            .aspectRatio(contentMode: .fit)
            .padding(6)
            .contentShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
            .hoverEffect(.highlight)
})

悬停效果会导致链接忽略第一次点击。用户必须双击才能激活链接。其他人是否有这种行为?如果有,我需要做什么才能在第一次点击时激活链接?

已解决:如果我将图像中的最后3行移到链接上,所有操作都会正常进行