UIActivityIndicatorView not displayed

I have the following piece of code:

UIActivityIndicatorView *av; -(void) createAndShowLoadingIndicator { av = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] ; av.frame=CGRectMake(10, 10, 250, 250); //av.center = self.view.center; av.tag = 1000; [self.view addSubview:av]; [self.view bringSubviewToFront:av]; [av startAnimating]; } 

In MyViewController.m , I call with [self createAndShowLoadingIndicator]; and wonder why this is not visible !? I do not see errors. What is the problem, how to make it visible?

+4
source share
1 answer

Try setting the color to white:

 [av setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite]; 
+4
source

Source: https://habr.com/ru/post/1495604/


All Articles