I am trying to put a UIActivityIndicatorView on a black background, however I can’t see it spinning. Why is this? Here’s what I have:
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[indicator setCenter:CGPointMake(0, 15)];
[indicator setBackgroundColor:[UIColor blackColor]];
[indicator startAnimating];
[indicator hidesWhenStopped];
Are you actually adding your ActivityIndicator as a subview somewhere ?
If not you should add it in viewDidLoad or somewhere else appropriate using:
Also I’m not sure if setBackgroundColor will have the desired effect you’re looking for. I achieve this using a UIImageView and a black image with radial corners. I also like to set the Alpha value of the black image to about 75 percent. Then whenever I call startAnimating I also show the imageView, and when I call stopAnimating I hide the imageview.