Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to change the bar color (Not the background) of progressView in SWIFTUI iOS16?

How to change the actual bar color, for the progress view?
I tried with the common methods, but does not seem to work and when checking the documentation inside xcode it says tint deprecated.
How to fix?

Here is my code:

ProgressView()
    .progressViewStyle(LinearProgressViewStyle(tint: .red))
    .background(.yellow)

I want the bar to be red.
How to fix?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You will need to put tint on the view. Like so:

ProgressView(value: 0.5)
    .progressViewStyle(LinearProgressViewStyle())
    .tint(.red) // <-- Right here
    .background(.yellow)

Hope this helps 🙂

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading