iPad centering activity indicator
I am writing an iPad app that has开发者_开发问答 a UIWebView and an activity indicator when the pages are loading in the webview. I think this is a stupid question but how can I make sure the activity indicator is centered at all times? if i have it vertical, it is centered, but if I turn the iPad horizontally, the activity indicator is now somewhere in the lower left quadrant rather than the center.
Thanks in advance!
UIActivityIndicatorView *progress_ind = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
progress_ind.center = CGPointMake (self.view.bounds.size.width * 0.5F, self.view.bounds.size.height * 0.5F);
[progress_ind startAnimating];
progress_ind.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);
[self.view addSubview:progress_ind];
精彩评论