圖片樣例:

代碼復(fù)制:
//加載網(wǎng)絡(luò)請(qǐng)求
- (void)loadRequest:(NSURLRequest *)request;
/*
? ? 功能:加載本地HTML字符串
? ? string為要加載的本地HTML字符串
? ? baseURL用來確定htmlString的基準(zhǔn)地址,相當(dāng)于HTML的標(biāo)簽的作用,定義頁面中所有鏈接的默認(rèn)地址
*/
- (void)loadHTMLString:(NSString *)string baseURL:(nullable NSURL *)baseURL;
/* 加載二進(jìn)制數(shù)據(jù) */
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType
? ? ? ? ? ? ? ? ? characterEncodingName:(NSString *)characterEncodingName
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? baseURL:(NSURL *)baseURL;
//計(jì)算webView的高度
-(void)webViewDidFinishLoad:(UIWebView *)webView{
? ? CGRect frame = webView.frame;
? ? frame.size.width = kScreenWidth - LQWidhScale(15)*3 - LQWidhScale(25);
? ? frame.size.height = 1;
? ? webView.scrollView.scrollEnabled = NO;
? ? webView.frame = frame;
? ? frame.size.height = webView.scrollView.contentSize.height;
? ? webView.frame = frame;
? ? self.answerWebView.frame = CGRectMake(LQWidhScale(15)*2 + LQWidhScale(25), 0, webView.width, webView.height);
? ? NSLog(@"self.answerWebView.frame = %@", [NSValue valueWithCGRect:frame]);
}