I'm trying to show red color in full screen.
If I use edgesIgnoringSafeArea(.all)
the screen automatically becomes scrolling enabled, which I don't want. Can you please advise me how to show red color on full screen without scrolling and without stretching because i change the color to image.
Any help would be greatly appreciated.
Sample code is given below.
import SwiftUI
struct PageSetup: View {
@State private var tabSelection = 0
var body: some View {
ZStack {
TabView(selection: $tabSelection) {
ForEach(0..<5) { index in
ZStack {
Color.red
Text("\(index)")
}
}
}
.tabViewStyle(PageTabViewStyle())
.onAppear {
UIScrollView.appearance().bounces = false
}
.tabViewStyle(PageTabViewStyle())
}
}
}
Output