我如何知道Web视图已加载完成

编程入门 行业动态 更新时间:2024-10-04 13:25:31
本文介绍了我如何知道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视图已加载完成

本文发布于:2023-11-26 23:17:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635610.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   加载   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!