The constant kActivityIndicatorSize is your choice.
- (void) turnActivityViewOn: (UIView *) currentView { CGRect screenRect = [[UIScreen mainScreen] bounds]; #define kActivityIndicatorSize 80 CGRect activityFrame = CGRectMake((screenRect.size.width/2.0) - (kActivityIndicatorSize/2.0),screenRect.size.height/2.0,kActivityIndicatorSize, kActivityIndicatorSize); self.activityView = [[UIActivityIndicatorView alloc] initWithFrame:activityFrame]; self.activityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; [window insertSubview: activityView aboveSubview: currentView]; [activityView release]; [activityView startAnimating]; } - (void) terminateActivityView { if (self.activityView == null) return; [activityView stopAnimating]; [activityView removeFromSuperview]; self.activityView = null; }
turnActivityOn ObjectiveCBridge performSelectorOnMainThreadDoNotWait: [self sharedApplication delegate turnActivityViewOn: self keyPadController view ]. turnActivityOff ObjectiveCBridge performSelectorOnMainThreadDoNotWait: [self sharedApplication delegate terminateActivityView].