tej
tej

Reputation: 60

How to load an activity indicator before scrollview even appears on my screen?

I am showing a scrollview on the screen and populating content and before it even appears on my screen i wanted to load a activity indicator view. i know how to do it using webview methods like below but not for scrollview , can somebody help me with the right methods for scrollview.

-(void)webViewDidStartLoad:(UIWebView *)webView{

}

(void)webViewDidFinishLoad:(UIWebView *)webView {

}

Upvotes: 0

Views: 499

Answers (1)

Catalina T.
Catalina T.

Reputation: 3494

There are no such methods for the scrollView because it is just a container for other views, there is no implicit loading involved like with the webView.

Therefore, you will have to keep track of the state of the content manually. One solution would be to add the activityIndicator in viewWillAppear: or awakeFromNib (depending if you are implementing your logic in the viewController or a custom UIView).

Then when your content is loaded, for example in the webView delegate methods, you stop the animating and, eventually, make the webView visible, if you want this kind of animation.

Let me know if you need more help or have any questions.

Upvotes: 1

Related Questions