UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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

3      

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()
    }
}

4      

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?

3      

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.

3      

@njansari: Yes I think so too. Thanks!

3      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.