我正在编写一个 iPad 应用程序,该应用程序在页面加载到 webview 时具有 UIWebView 和活动指示器。我认为这是一个愚蠢的问题,但我怎样才能确保活动指示器始终居中?如果我让它垂直,它是居中的,但如果我水平转动 iPad,活动指示器现在位于左下象限而不是中心的某个位置。
提前致谢!
我正在编写一个 iPad 应用程序,该应用程序在页面加载到 webview 时具有 UIWebView 和活动指示器。我认为这是一个愚蠢的问题,但我怎样才能确保活动指示器始终居中?如果我让它垂直,它是居中的,但如果我水平转动 iPad,活动指示器现在位于左下象限而不是中心的某个位置。
提前致谢!
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];