문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top