IOS UIWebView Loading progress bar usage

Source: Internet
Author: User

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

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.