Here is an example of what i currenly have:
struct ContentView: View {
var body: some View {
NavigationView {
ScrollView {
VStack() {
Text("Foo")
}
.frame(maxWidth: .infinity, idealHeight: 200)
.background(Color(uiColor: .systemBackground))
}
.background(Color(uiColor: .secondarySystemBackground))
.navigationTitle("Title")
}
}
}
What i want to achieve is the white background all the way up to the top of the screen while preserving the padding so that the actual content of the VStack
is displayed below the title and not underneath it and when scroll happens VStack
's content follows the title when it goes from large to inline.