I've made vertical paging but the TabViewStyle function supports the minimum iOS 14.0. However, I want my application to work in the minimum iOS 13.0 version. How can I disable indexDisplayMode?
Gif:
Code:
struct PagingQuestionView: View {
let colors: [Color] = [
.red, .green, .blue, .gray
]
var body: some View {
GeometryReader { proxy in
TabView {
ForEach(colors, id: \.self) { color in
color // Your cell content
}
.rotationEffect(.degrees(-90)) // Rotate content
.frame(
width: proxy.size.width,
height: proxy.size.height
)
}
.frame(
width: proxy.size.height, // Height & width swap
height: proxy.size.width
)
.rotationEffect(.degrees(90), anchor: .topLeading) // Rotate TabView
.offset(x: proxy.size.width) // Offset back into screens bounds
.tabViewStyle(
PageTabViewStyle(indexDisplayMode: .never)
)
}
}
}
Error: