I want a TabView that uses a PageTabViewStyle with each individual screen having a different background colour that fills the entire vertical space available (i.e. extended into the safe areas).
TabView(selection: $selection) {
VStack {
Text("screen 1")
}.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.green)
VStack {
Text("screen 2")
}.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.red)
}.edgesIgnoringSafeArea(.all)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
However, it looks like this:
And after I scroll to the bottom:
The white colour can be changed if I set a background colour for the TabView itself, which would be fine if each screen used the same background colour. Is there any way for individual screens within the TabView to have a unique background colour set that fills the entire screen?