I created ScrollView inside GeometryReader and NavigationView like this:
var body: some View {
NavigationView {
GeometryReader { geo in
ScrollView {
ZStack(alignment: .top) {
VStack(spacing: 0) {
ZStack {
Rectangle()
.fill(Color.background)
.frame(width: geo.size.width, height: geo.size.height * 0.3)
.background(Color.background)
.environment(\.colorScheme, .dark)
renderImage(blur: 0)
.frame(width: (geo.size.width * 0.25), height: (geo.size.width * 0.25))
.offset(x: -(geo.size.width * 0.45), y: geo.size.height * 0.12)
renderImage(blur: 1)
.frame(width: (geo.size.width * 0.2), height: (geo.size.width * 0.2))
.offset(x: geo.size.width * 0.46, y: -(geo.size.height * 0.05))
renderImage(blur: 1.5)
.frame(width: (geo.size.width * 0.15), height: (geo.size.width * 0.15))
.offset(x: geo.size.width * 0.45, y: geo.size.height * 0.1)
}
Rectangle()
.fill(Color.background)
.frame(width: geo.size.width, height: geo.size.height)
}
VStack {
renderHeader()
renderNewElements()
renderForEachItems()
.padding()
}
}
}
.addAppThemeBackground()
.navigationBarHidden(true)
}
}
}
Problem here is that I can scroll only specified height (I cant scroll to see all ForEachItems, screen can only scroll a little).
I tried to use fixedSize(), .frame(minHeight: geo.size.height), .frame(minHeight: geo.size.height, maxHeight: .infinity), .frame(height: geo.size.height), but neither one works. I also tried to add those modifiers to VStack which contains methods, but result is always the same.
I used those ZStacks to achieve design where 30% of screen is dark color, then Images are added, new Rectangle which Color cover some of Image size and at the end VStack which contains values.
renderHeader() and renderNewElements have .fixedSize() modifier.
I also noticed when I am scrolling (how much I can), elements of the renderForEachItems can be seen under the TabView.