天天看點

UIWebView加載網頁

- (void)backClick{

    if ([_webView canGoBack]) {

        [_webView goBack];

    }else{

        [self.navigationController popToRootViewControllerAnimated:YES];

    }

}

- (void)createWebWiew{

    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];

    _webView.delegate = self;

    _webView.scalesPageToFit = YES;

    [self.view addSubview:_webView];

    NSURL *url =[NSURL URLWithString:self.url];

    NSURLRequest *request =[NSURLRequest requestWithURL:url];

    [_webView loadRequest:request];

}

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

}

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

}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{

}