change TabView indicator SwiftUI

Pingo

enter image description here

Is there a way to change the tabView Indicator color in swiftUI ?

This is my code

struct OnBoarding: View {
    var body: some View {
        
        TabView {
            ForEach(0 ..< 3) { item in
                VStack {

                    Image("discover")
                        .resizable()
                        .scaledToFit()
                    
                }
            }
        }

        .tabViewStyle(PageIndexViewStyle(backgroundDisplayMode: Color ?))
        
    }
}

struct OnBoarding_Previews: PreviewProvider {
    static var previews: some View {
        OnBoarding()
    }
}

I tried tabViewStyle(PageIndexViewStyle(backgroundDisplayMode: Color ?)) but can't get around with it

Achraf

you need to use UIkit

 init() {
    UIPageControl.appearance().currentPageIndicatorTintColor = .red
    UIPageControl.appearance().pageIndicatorTintColor = UIColor.black.withAlphaComponent(0.2)
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related