MatiasVian
MatiasVian

Reputation: 9

How to prevent Voiceover resetting to the first page when navigating SwiftUI TabView?

I want to use Voiceover to navigate a simple TabView with .page styling, but it keeps jumping back to page 0 when I navigate using the dots (swiping up).

Is this a bug? How can I override it?

Gif of problem

My Code:

import SwiftUI

struct ContentView: View {

    @State var tab: Int = 0

    var body: some View {
        TabView(selection: $tab) {

            VStack {
                Text("Page 0")
            }
            .tag(0)

            VStack {
                Text("Page 1")
            }
            .tag(1)

            VStack {
                Text("Page 2")
            }
            .tag(2)
        }
        .tabViewStyle(.page)
    }
}

Upvotes: 1

Views: 147

Answers (0)

Related Questions