我如何知道Web视图已加载完成 [英] How can i know web view is loading completed
本文介绍了我如何知道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].networkActivityIndicatorVisible = YES;
// Other stuff...
}
然后
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[UIApplication sharedApplication].networkActivityIndicatorVisible = 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].networkActivityIndicatorVisible = NO;
// Other stuff...
}
这篇关于我如何知道Web视图已加载完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文