【问题标题】:iPad centering activity indicatoriPad 居中活动指示器
【发布时间】:2010-11-18 17:11:16
【问题描述】:

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

提前致谢!

【问题讨论】:

    标签: ipad webview uiactivityindicatorview


    【解决方案1】:
    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];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-18
      • 2014-01-08
      • 1970-01-01
      • 1970-01-01
      • 2017-08-04
      • 2011-06-28
      • 2012-06-08
      • 2010-11-08
      相关资源
      最近更新 更多