iPad中心活动指标

cha*_*gus 0 webview uiactivityindicatorview ipad

我正在编写一个iPad应用程序,当在webview中加载页面时,该应用程序具有UIWebView和活动指示器.我认为这是一个愚蠢的问题,但我怎样才能确保活动指标始终居中?如果我有垂直,它居中,但如果我水平转动iPad,活动指示器现在位于左下象限而不是中心.

提前致谢!

jwa*_*ent 6

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];
Run Code Online (Sandbox Code Playgroud)