Reputation: 2639
I want to put a big spinner along with a "Loading message..." or a gif image, when UIWebView loads its contents so it won't just show a blank view. How should I do it?
Upvotes: 8
Views: 8070
Reputation: 1087
Implement the UIWebView Delegate as outlined in Mihir's answer above but don't forget to assign the delegate otherwise the delegate methods will not be triggered
For example In ViewDidLoad you should add:
self.myWebView.delegate = self;
Upvotes: 2
Reputation: 13843
implement UIWebview's delegate method put this code in it
- (void)webViewDidStartLoad:(UIWebView *)webView {
[activityIndicator startAnimating];
myLabel.hidden = FALSE;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[activityIndicator stopAnimating];
myLabel.hidden = TRUE;
}
set ActivityIndicater's Hidden when stop property to TRUE
Upvotes: 20