Closed KavinduDissanayake closed 4 months ago
@FulcrumOne Any Update ?
hey @KavinduDissanayake,
Unfortunately this appears to be a SwiftUI bug that we cannot fix - we suggest you calculate the height of your content by yourself and set it at the end of the view:
func createContent() -> some View {
GeometryReader{ geo in
VStack(alignment: .leading, spacing: 0) {
Text("Test")
createTitle()
Spacer.height(16)
createDescription()
Spacer.height(36)
createButtons()
}
.padding(.top, 32)
.padding(.bottom, 12)
.padding(.horizontal, 28)
.calculateHeight($contentHeight)
}
.frame(height: contentHeight)
}
Sorry for the delay and have a nice weekend!
P.S. The best choice for calculating content height seems to be the archorPreference
function.
When I wrap using GeometryReader ,I got results like below image
Code Snippet
Demo: