本文介绍了我如何知道Web视图已加载完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有网络视图,因为我正在加载pdf文件.
i have web view in that i am loading pdf file .
pdf文件的大小为2 mb,因此需要打钉时间.我想添加指标.
pdf file has 2 mb size so it tacking time. i want to add indicator .
为此,我如何知道我的文件已加载到Web视图中? ...
for that how can i know my file is loaded in web view ? ...
推荐答案James P的答案正确(^'ed),但这是显示和隐藏指标的代码.
James P has the right answer (^'ed), but here is the code to show and hide the indicator.
在 UIWebViewDelegate ...
- (void)webViewDidStartLoad:(UIWebView *)webView { [UIApplication sharedApplication]workActivityIndicatorVisible = YES; // Other stuff... }然后
- (void)webViewDidFinishLoad:(UIWebView *)webView { [UIApplication sharedApplication]workActivityIndicatorVisible = NO; // Other stuff... }您可能还想检查故障并在那里隐藏活动指示器...
Also you probably want to check for failures and hide the activity indicator there as well...
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { [UIApplication sharedApplication]workActivityIndicatorVisible = NO; // Other stuff... }更多推荐
我如何知道Web视图已加载完成
发布评论