1, will download the 3rd party class Library Mbprogresshud source Package added to the project (in fact, is a. h and. m files)
2, enter the project build phases, the source package inside all the. m files are added to the project
3, add the 3rd party class Library's main header file " MBProgressHUD.h "
Display code:
Start loading, display cue bar mbprogresshud *hud = [Mbprogresshud showhudaddedto:webview animated:yes]; Add a layer mask hud.dimbackground = YES; Hud.labeltext = @ "page loaded ...";
Hide Code:
Once loaded, hide the cue bar [Mbprogresshud Hideallhudsforview:webview Animated:yes];
Custom Display Picture:
Extracted, only for categorical internal calls + (void) ShowMsg: (NSString *) msg imgname: (NSString *) imgname{ //Display to main window Mbprogresshud *hud =[ Mbprogresshud showhudaddedto:[uiapplication Sharedapplication].keywindow Animated:yes]; Display mode, change to CustomView, that is, display a custom picture (mode setting, must be written before CustomView Assignment) hud.mode = Mbprogresshudmodecustomview; int delay = 1; if ([Imgname isequaltostring:@ "Error.png"]) { //error, Prompt for 3 seconds delay = 3; } Imgname = [NSString stringwithformat:@ "mbprogresshud.bundle/%@", imgname]; Set the custom picture to display Hud.customview = [[Uiimageview alloc] initwithimage:[uiimage Imagenamed:imgname]]; Displayed text, such as: Load failed ... Loading in ... Hud.labeltext = msg; Flag: Must be yes to hide and remove Hud.removefromsuperviewonhide = yes from parent control when hidden; Log is automatically hidden after 3 seconds (@ "%d", delay); [HUD Hide:yes afterdelay:delay];}
Other Common Properties
The background color of the cue box Hud.color = [Uicolor clearcolor];//here means little text with no background//hint below hud.detailslabeltext = @ "Detail"; Shadow Matte effect hud.dimbackground = YES; Hide [HUD Hide:yes afterdelay:1] after 1 seconds; Show Text Only hud.mode = Mbprogresshudmodetext; Margin and y-direction offset hud.margin = 0; Hud.yoffset = 0; Remove hud.removefromsuperviewonhide = YES from the parent control after hiding; Round progress bar Hud.mode = Mbprogresshudmodeannulardeterminate;