1/Drag it to your own??
2/This is the steps introduced in the original text: But after the addition, the background back to a brief green, I do not want the flash of the state
#import "InspectionReportViewController.h"#import "NJKWebViewProgressView.h"#import "NJKWebViewProgress.h"@interfaceInspectionreportviewcontroller () <UIWebViewDelegate,NJKWebViewProgressDelegate>{UIWebView*WebView; Njkwebviewprogressview*_progressview; Njkwebviewprogress*_progressproxy; }@end@implementationInspectionreportviewcontroller-(void) Viewwilldisappear: (BOOL) animated{[Super viewwilldisappear:animated]; //End of page remove view[_progressview Removefromsuperview];}- (void) viewdidload {[Super viewdidload]; //Do any additional setup after loading the view.WebView=[[UIWebView alloc] initWithFrame:self.view.bounds]; Webview.backgroundcolor=[Uicolor Blackcolor]; [WebView loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringWithFormat:@"Http://www.baidu.com]]; Webview.scalespagetofit = YES; webview.scrollView.scrollEnabled = NO; [Self.view Addsubview:webview]; _progressproxy = [[Njkwebviewprogress alloc] init]; Webview.delegate = _progressproxy; _progressproxy.webviewproxydelegate = self; _progressproxy.progressdelegate = self; CGFloat progressbarheight = 2.f; CGRect navigationbarbounds = self.navigationController.navigationBar.bounds; CGRect barframe = CGRectMake (0, Navigationbarbounds.size.height-progressbarheight-iphonehight (40), NavigationBarBounds.size.width, Progressbarheight); _progressview = [[Njkwebviewprogressview alloc] initwithframe:barframe]; _progressview.autoresizingmask = Uiviewautoresizingflexiblewidth | Uiviewautoresizingflexibletopmargin; [WebView Addsubview:_progressview]; }//Proxy method #pragma mark-njkwebviewprogressdelegate-(void) webviewprogress: (njkwebviewprogress *) webViewProgress UpdateProgress: (float) progress{[_progressview setprogress:p rogress Animated:yes]; }
3/. At the bottom of the question price?? Below??
njkwebviewprogressview.m
//in this method, modify the-(void) configureviews{Uicolor*tintcolor = [Uicolor Clearcolor];//iOS7 Safari Bar Color}//The second time the change in this method. In the second row- (void) Setprogress: (float) Progress animated: (BOOL) animated{bool Isgrowing= Progress >0.0; //The following method is added in the_progressbarview.backgroundcolor = [Uicolor colorwithred: A. F/255. F Green:126. F/255. F Blue:251. F/255. F Alpha:1.0]; ;
IOS UIWebView Loading progress bar usage