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      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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.