2010-07-19 4 views

Répondre

6
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 

ou

[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 

fera l'affaire!

modifier: trouvé celui-ci dans un projet plus ancien, le client a demandé un indicateur avec une meilleure visibilité:

-(void)invokeMegaAnnoyingPopup 
{ 
    self.megaAlert = [[[UIAlertView alloc] initWithTitle:@"Please wait..." 
     message:nil delegate:self cancelButtonTitle:nil 
     otherButtonTitles: nil] autorelease]; 

    [self.megaAlert show]; 

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

    indicator.center = CGPointMake(self.megaAlert.bounds.size.width/2, 
            self.megaAlert.bounds.size.height - 45); 
    [indicator startAnimating]; 
    [self.megaAlert addSubview:indicator]; 
    [indicator release]; 
} 

-(void)dismissMegaAnnoyingPopup 
{ 
    [self.megaAlert dismissWithClickedButtonIndex:0 animated:YES]; 
    self.megaAlert = nil; 
} 

Vous bien sûr besoin d'un UIAlertView *megaAlert; défini dans votre classe.

Questions connexes