Question

I need to make a large spinner (with grey style, about 80x80px) but it looks low quality. Is there a way to make it high quality or to replace the animated image?

Was it helpful?

Solution

It can't be done using UIActivityIndicatorView. you can however write your own subclass of UIView using an UIImageView and some simple animation to do this for you.

OTHER TIPS

Actually, you can set the indicator style of your UIActivityIndicatorView to Large White, and then in code do this:

// Objective-C
[myActivityView setColor:[UIColor grayColor]];
// Swift 4.0
myActivityView.color = .grayColor

Swift 2.0 Solution

myActivityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge
myActivityView.color = UIColor.grayColor()

Swift 3

extension UIActivityIndicatorView {
    func makeLargeGray() {
        activityIndicatorViewStyle = .whiteLarge
        color = .gray
    }
}

Swift 4.2

extension UIActivityIndicatorView {
    func makeLargeGray() {
        style = .whiteLarge
        color = .gray
    }
}

A useful project that you can start off with is MBProgressHUD.

You could try something like:

activityIndicator.transform = CGAffineTransform(scaleX: 1.3, y: 1.3)

However, if you make it big enough, you'll be able to see the pixels...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top