UIWebView 中带有 TabBar 的 ActivityIndi​​cator

发布于 2024-10-08 05:30:53 字数 490 浏览 6 评论 0原文

我希望有人能帮助我。

我有一个 TabBar,其中包含一些 WebView 和每一侧的 ActivityIndi​​cator。 当侧面加载时如何隐藏这个?

我尝试过,

- (void)webViewDidStartLoad:(UIWebView *)webView1{
      NSLog(@"Start test");
      [activityIndicator startAnimating];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView1{
      NSLog(@"Stop test");
     [activityIndicator stopAnimating];
     [activityIndicator hidesWhenStopped];
}  

但该函数甚至没有被调用。

我将它们放置在调用 webView 的 ViewController 中。

I hope some one can help me with that.

I have a TabBar with some WebViews and an activityIndicator for each side.
how can I hide this one when the side is Loaded?

I tryed it with

- (void)webViewDidStartLoad:(UIWebView *)webView1{
      NSLog(@"Start test");
      [activityIndicator startAnimating];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView1{
      NSLog(@"Stop test");
     [activityIndicator stopAnimating];
     [activityIndicator hidesWhenStopped];
}  

but the function dosen't even get called.

I placed them in the ViewController where the webView is called.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抽个烟儿 2024-10-15 05:30:53

您是否已将您的班级设为 UIWebView 的委托?

[webview setDelegate:self];

您还应该将您的班级声明为委托:

@interface ClassName : NSObject <UIWebViewDelegate>

Have you made your class the delegate for UIWebView?

[webview setDelegate:self];

You should also declare your class as a delegate:

@interface ClassName : NSObject <UIWebViewDelegate>
十六岁半 2024-10-15 05:30:53

UIWebView 除外:

[pActivityIndicatorView startAnimating];
[self performSelector:@selector(fnWillCall) withObject:nil afterDelay:0.5];
[pActivityIndicatorView startanimating];
[pActivityIndicatorView stopanimating];

UIWebView:

- (void)webViewDidStartLoad:(UIWebView *)webView {
       [pActivityIndicatorView startAnimating];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
       [pActivityIndicatorView stopAnimating];
}

Except UIWebView :

[pActivityIndicatorView startAnimating];
[self performSelector:@selector(fnWillCall) withObject:nil afterDelay:0.5];
[pActivityIndicatorView startanimating];
[pActivityIndicatorView stopanimating];

UIWebView :

- (void)webViewDidStartLoad:(UIWebView *)webView {
       [pActivityIndicatorView startAnimating];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
       [pActivityIndicatorView stopAnimating];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文