How do I use a progress indicator in the example of uiactivityindicatorview?

Source: Internet
Author: User
How do I use a progress indicator?

 

// Implementviewdidload to do additional setup after loading the view, typically from anib.

-(Void) viewdidload {

// Load the spinner here
Note that the webview setdelegate: Self
Statement. Only the following four web views can be processed.
Heavy Load Process

Spinner = [[uiactivityindicatorview alloc] initwithframe: cgrectmake (0, 0, 50, 50)];

[Spinnersetcenter: cgpointmake (350,350)]; // I do this because I'm in Landscape mode

[Spinnersetactivityindicatorviewstyle: uiactivityindicatorviewstylegray];

[Self. viewaddsubview: spinner]; // spinner is not visible until started

[Webviewsetdelegate: Self];

 

[Superviewdidload];

}

# Pragma mark-

# Pragma mark Web View Lifecycle

 

-(Void) webviewdidstartload :( uiwebview *) webview

{

[Spinnerstartanimating];

// Opaqueview. Hidden = no;

}

 

-(Void) webviewdidfinishload :( uiwebview *) webview

{

[Spinnerstopanimating];

// [Spinner release];
* ** If you use this sentence here, an error may occur and the screen is stopped, especially when different content is repeatedly refreshed on the same screen. It also indicates that in some cases, release is enabled in advance.
Some variables may cause problems.

// Opaqueview. Hidden = yes;

}

 

-(Bool) webview :( uiwebview *) webviewshouldstartloadwithrequest :( nsurlrequest *) requestnavigationtype :( uiwebviewnavigationtype) navigationtype

{

// [Spinnerstartanimating];

Returnyes;

}

 

-(Void) webview :( uiwebview *) webviewdidfailloadwitherror :( nserror *) Error

{

[Spinnerstopanimating];

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.