UIActivityIndi​​catorView不可见

时间:2013-08-06 19:40:46

标签: ios uiactivityindicatorview

我有以下代码部分:

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];通话,并想知道为什么不可见!?我看不出任何错误。问题是什么,如何让它可见?

1 个答案:

答案 0 :(得分:4)

尝试将颜色设置为白色:

[av setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhite];