2011-04-21 69 views

回答

2

我想你可以通过这个做 -

UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"title" message:@"\n\n" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:nil]; 
    UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(130.0f, 50.0f, 20.0f, 20.0f)]; 
    [activityIndicator startAnimating]; 
    [alertview addSubview:activityIndicator]; 
    [alertview show]; 
    [alertview release]; 
    [activityIndicator release]; 
+0

您还需要释放activityIndi​​cator。 – progrmr 2011-04-21 05:57:34

+0

是的,我编辑了我的答案。 – saadnib 2011-04-21 07:18:43

2
UIAlertView *alert; 



alert = [[[UIAlertView alloc] initWithTitle:@"Configuring Preferences\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease]; 
[alert show]; 

UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 

// Adjust the indicator so it is up a few pixels from the bottom of the alert 
indicator.center = CGPointMake(alert.bounds.size.width/2, alert.bounds.size.height - 50); 
[indicator startAnimating]; 
[alert addSubview:indicator]; 
[indicator release];