Running PageTabViewStyle in landscape orientation on any iPhone with a notch results in odd spacing on the leading side of the view, edgesIgnoringSafeArea does not seem to be working correctly? Adding a second Edges ignore in the body seems to help, but still left with a leading white area. PageTabViewStyle and edgesIgnore seem to work fine on older non-notch phones. Anyone know a solution to this problem?
import SwiftUI
struct TestTabView: View {
var colors : [Color] = [.red, .yellow, .blue, .green]
@State private var page: Int = 1
var body: some View {
TabView (selection: $page){
ForEach(0..<colors.count, id: \.self) {index in
Rectangle().foregroundColor(colors[index]).edgesIgnoringSafeArea(.all)
.tag([index])
}
}
.tabViewStyle(PageTabViewStyle())
.edgesIgnoringSafeArea(.all)
}
}
struct TestTabView_Previews: PreviewProvider {
static var previews: some View {
TestTabView()
}
}
Selecting any option will automatically load the page