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.
you need to use UIkit
init() {
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor(.primary)
UIPageControl.appearance().pageIndicatorTintColor = UIColor(.secondary)
}