Thursday, November 25, 2010

Invisible UIActivityIndicatorView loading activity indicator on iPhone4

I found that a UIActivityIndicatorView is invisible on iphone4 while it's working fine on simulator or earlier iphone version. And it's because "UIActivityIndicatorViewStyleWhiteLarge" is invisible on white background on iphone4. After change style to "UIActivityIndicatorViewStyleGray", it shows up but no "large" option.



if (spinner==nil){
spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[spinner setCenter:self.view.center];
[self.view addSubview:spinner];
}
[spinner startAnimating];
// do your loading job
[spinner stopAnimating];

No comments:

Post a Comment