首先在h文件申明: UIActivityIndicatorView *opaqueview; UIActivityIndicatorView *spinner; 其次,再m文件代码如下: -(void)viewWillAppear:(BOOL)Animated{ opaqueview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:CGPointMake(kScreenWidth/2.0, kScreenHeight/3.0)]; // I do this because I'm in landscape mode // spinner is not visible until started [opaqueview setBackgroundColor:[UIColor blackColor]]; [opaqueview setAlpha:0.8]; [self.view addSubview: opaqueview]; [opaqueview addSubview:spinner]; [self.view addSubview:spinner]; [spinner release]; } 开始等待数据: [spinner startAnimating]; opaqueview.hidden = NO; 数据结束: [spinner stopAnimating]; opaqueview.hidden = YES;