WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

Make the circular ProgressView() bigger

Forums > SwiftUI

Hi everyone!

I wanted to ask if there is a way to resize SwiftUI's circular ProgressView()? I've already tried the following:

ProgressView("Computer waiting...")
.frame(width: 120, height: 120, alignment: .center)
.font(.system(size: 100))

Or this, which is a pretty ugly option:

ProgressView("Computer waiting...")
.scaleEffect(5)

Based on a quick google search, I guess it's not possible?

Thanks

1      

What effect are you after, because this code gives three differnet versions?

If it's none of these then provide a bit more detail of what you need.

struct ContentView: View {        // layout suited to iphone 12 Pro Max simulator
    var body: some View {
        Spacer()
        Section() {
            ProgressView("Uploading…")    // small spinner and larger text
                .scaleEffect(2)
                .font(.title)
        }
        Spacer()
        Section() {
            ProgressView("Downloading…")    // larger spinner and smaller text
                .scaleEffect(5)
                .font(.system(size:8))
        }
        Spacer()
        Section() {  
            ProgressView()     // very large spinner and no text
                .scaleEffect(8)
        }
        Spacer()
    }
}

2      

Thanks a lot for your reply!

I basically want the result of the third option, a larger ProgressView(). But using scale seems to distort it and doesn't render nice. Am I right? Is there anyway to enlarge it clean and in high resolution?

1      

If your looking for the UIActivityIndictorView with a .large style equivalent, then there is no way to do this in SwiftUI as of iOS 15. What I would have expected to work was adding the .controlSize(.large) modifier to the ProgressView, but I guess that functionality is only limited to buttons in iOS.

1      

@njansari: Yes I think so too. Thanks!

1      

Hacking with Swift is sponsored by Fernando Olivares

SPONSORED Fernando's book will guide you in fixing bugs in three real, open-source, downloadable apps from the App Store. Learn applied programming fundamentals by refactoring real code from published apps. Hacking with Swift readers get a $10 discount!

Read the book

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.