[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
UIWebView在加载的时候默认是没有在状态栏显示有网络请求的提示器,需要我们手动添加。
方法如下:
<pre>
pragma mark - UIWebViewDelegate Protocol Methods
-
(void)webViewDidStartLoad:(UIWebView *)webView{
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
} -
(void)webViewDidFinishLoad:(UIWebView *)webView{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
</pre>
也可以配合UIActivityIndicatorView
或者MBProgressHUD
或者SVProgressHUD
一起使用
Add an activity indicator on a uiwebview
IOS - 网络指示器