0

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:

enter image description here

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:

enter image description here

Ufuk Köşker
  • 1,288
  • 8
  • 29
  • Does this answer your question https://stackoverflow.com/a/63077687/12299030? – Asperi Jul 30 '21 at 12:27
  • @Asperi This worked.. but why ? How did this work in iOS 13 ? Because IOS14 condition is in the if parameter. (if #available(iOS 14.0, *)) Can you explain for me ? – Ufuk Köşker Jul 30 '21 at 12:31

0 Answers0