您好,我在 SwiftUi 中遇到图像问题,我有这样的布局:

图像和健身是可点击的,但是当我单击健身时打开图像页面。
这是我的代码:
VStack {
HStack(alignment: .center) {
NavigationLink(destination: FullNewsListView(category: "Fitness")) {
Text("Fitness")
.foregroundColor(Color("#29B1B3"))
.font(Font.custom("AvenirNextLTPro-Bold", size: 20))
Image("forward_blue")
}
Spacer()
}
.padding(.bottom, 10)
VStack(alignment: .leading, spacing: 10) {
HStack {
URLImage(URL(string: "http://myPhoto")!) { proxy in
proxy.image
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 180)
.cornerRadius(12)
.clipped()
}
}
HStack {
Text(api.newsFitnessHome.news!.title)
.foregroundColor(.black)
.font(Font.custom("AvenirNextLTPro-Demi", size: 15))
.opacity(0.8)
.lineSpacing(5)
.lineLimit(2)
.fixedSize(horizontal: false, vertical: true)
Spacer()
}
}
}
.padding(.horizontal, 30)
Run Code Online (Sandbox Code Playgroud)