Hi guys, I have a really odd problem. Whenever I try to add a vertical ScrollView, VStack or a LazyVStack to this code everything disappears. Anyone have an idea why this is happening and how to fix it? No errors show up in my code.
GeometryReader{ geometry in
VStack(alignment: .center, spacing: 100){
ScrollView(.horizontal, showsIndicators: false){
HStack(spacing: 250){
CardView1(
showOnlyImage: false,
imagename1: "TheMiceGalaxiesHubble",
heading1: "The Mice Galaxies",
description1: "Located in the constellation Coma Berenices."
)
.scaleEffect(getScale(proxy: geometry))
.animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry))
CardView1(
showOnlyImage: false,
imagename1: "TheMiceGalaxiesHubble",
heading1: "The Mice Galaxies",
description1: "Located in the constellation Coma Berenices."
)
.scaleEffect(getScale(proxy: geometry))
.animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry))
}
}
.frame(height: -200)
ScrollView(.horizontal, showsIndicators: false){
HStack(spacing: 250){
CardView1(
showOnlyImage: false,
imagename1: "TheMiceGalaxiesHubble",
heading1: "The Mice Galaxies",
description1: "Located in the constellation Coma Berenices."
)
.scaleEffect(getScale(proxy: geometry))
.animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry))
}
}
}
}
}
.contentMargins(50, for: .scrollContent)
.scrollTargetBehavior(.viewAligned)
.scrollTargetLayout()
.padding(.horizontal, 10)
.padding(.top, -35)
.padding(.bottom, 50)
}
}
}
}
}