4

我有以下代码部分:

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];
}

MyViewController.m,我打电话来[self createAndShowLoadingIndicator]; ,想知道为什么不可见!?我看不出有什么错误。有什么问题,如何使它可见?

4

1 回答 1

4

尝试将颜色设置为白色:

[av setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];
于 2013-08-06T19:44:19.057 回答