2011-05-11 91 views

回答

1
-(void)showActivityViewer { 
self.activityView = [[[UIView alloc] initWithFrame: CGRectMake(0, 0, self.view.window.bounds.size.width, self.view.window.bounds.size.height)] autorelease]; 
activityView.backgroundColor = [UIColor blackColor]; 
activityView.alpha = 0.5; 

self.activityWheel = [[[UIActivityIndicatorView alloc] initWithFrame: CGRectMake(self.view.window.bounds.size.width/2 - 12, self.view.window.bounds.size.height/2 - 12, 24, 24)] autorelease]; 
activityWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; 
activityWheel.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | 
            UIViewAutoresizingFlexibleRightMargin | 
            UIViewAutoresizingFlexibleTopMargin | 
            UIViewAutoresizingFlexibleBottomMargin); 
[activityView addSubview:activityWheel]; 
[self.view.window addSubview: activityView]; 
[[[activityView subviews] objectAtIndex:0] startAnimating]; 
} 

-(void)removeActivityViewer { 
[activityWheel removeFromSuperview]; 
[activityView removeFromSuperview]; 
self.activityWheel = nil; 
self.activityView = nil; 
} 
+0

Thanx朋友... – 2011-05-11 09:38:44