开发者

iPad centering activity indicator

开发者 https://www.devze.com 2023-01-26 06:53 出处:网络
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

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号