Post not yet marked as solved
Post marked as unsolved with 1 replies, 363 views
Hello, I am beginner and have a question about making scrollview content open detail view for the item selected. Each item has an image and image name which are pulled from an array .. Any suggestions how to best handle. This is what I have so far .. code wise ....
struct FishGuideView: View {
@State var fishes = Fish.fishData
var body: some View {
VStack {
Text("Fish Guide")
.font(.largeTitle)
.multilineTextAlignment(.center)
.padding(.horizontal, 2.0)
ScrollView(.horizontal) {
LazyHStack(spacing: 16.0){
ForEach(fishes) { item in
VStack {
GroupBox {
Image(item.fishImage)
.resizable()
.frame(width: 100, height: 88.0)
.clipShape(ContainerRelativeShape())
Text(item.fishName)
.font(.caption)
.fontWeight(.semibold)
.multilineTextAlignment(.center)
.lineLimit(4)
.padding(.top)
}
.frame(width: 150, height: 200.0, alignment: .center)
}
}
} //* -END LAZYVSTACK
} //* -END SCROLLVIEW
}
}
} //* -END STRUCT