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

Pugalmuni picture Pugalmuni · Jun 8, 2010 · Viewed 33.5k times · Source

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.

Answer

Cesar picture Cesar · Dec 13, 2011

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.