How to change ProgressView accentColor in SwiftUI?

Viewed 4456

This doesn't apply

ProgressView("\(spinnerLabel)")
    .accentColor(.white)

This changes the label

.foregroundColor(.white)

enter image description here

3 Answers

Try the following:

For iOS15+

.tint(.white)

For iOS13+

.progressViewStyle(CircularProgressViewStyle(tint: Color.white))

The selected answer contains a deprecated method, init(tint:).

This is the new way to change the tint color:

ProgressView()
    .tint(.white)

SwiftUI 3

.tint(Color) changes the current progress color while .background() changes the background of the progress view.

ProgressView(value: summary.ratio)
                    .tint(.white)
                    .background(.black)

enter image description here

Related