iOS使用webView加载HTML网页链接简单展示

//网页视图

_webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 64, mWidth, mHeight-64)];

_webView.delegate = self;

[self.view addSubview:_webView];

//加载

//1、生成请求体

NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.linkStr]];

//2、webView加载请求体

[_webView loadRequest:request];

#pragma mark webViewDel

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;

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

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

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