loading的两种常用方式

loading的两种常用方式

1、

    UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

    [self.tableView addSubview:loadingView];

    [loadingView startAnimating];

    // 居中

    loadingView.centerX=self.view.centerX;

    loadingView.centerY=self.tableView.height*0.4;

 

    self.loadingView = loadingView;

 [self.loadingView stopAnimating];

 

2、

- (void)webViewDidFinishLoad:(UIWebView *)webView {

    [MBProgressHUD hideHUDForView:self.view animated:YES];

}

 

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {

    [MBProgressHUD hideHUDForView:self.view animated:YES];

}

 

- (void)webViewDidStartLoad:(UIWebView *)webView {

    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];

    hud.mode = MBProgressHUDModeIndeterminate;

    hud.labelText = @"Loading...";

 

}

posted @ 2015-01-26 18:25  luseike  阅读(470)  评论(0编辑  收藏  举报