Search code examples
iosiphoneuiactivityindicatorview

Is it possible to change an UIActivityIndicatorView color to black in iOS?


I want to change an activity indicator color gray/white to black. Is it possible to change the color to black? If yes, please guide me or give some sample code.


Solution

  • You can use the .color property in order to change the UIActivityIndicatorView color, e.g.:

    // Objective-C
    activityIndicator.color = [UIColor greenColor];
    
    // Swift
    activityIndicator.color = .green
    

    Note that .color is only available from iOS 5.