Home > AI > IOS > SwiftUI >

PageTabViewStyle has problem in IPhone 12

Working code:

ScrollView {
    TabView {
        Rectangle().fill(Color.blue)
        Rectangle().fill(Color.yellow)
        Rectangle().fill(Color.green)
    }
    .frame(width: home.screenWidth,
           height: home.screenHeight-50)
    .tabViewStyle(PageTabViewStyle())
}
.edgesIgnoringSafeArea(.all)

give the TabView a frame and wrap the TabView with ScrollView

Leave a Reply