图片样例:
代码复制:
//加载网络请求
- (void)loadRequest:(NSURLRequest *)request;
/*
功能:加载本地HTML字符串
string为要加载的本地HTML字符串
baseURL用来确定htmlString的基准地址,相当于HTML的标签的作用,定义页面中所有链接的默认地址
*/
- (void)loadHTMLString:(NSString *)string baseURL:(nullable NSURL *)baseURL;
/* 加载二进制数据 */
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType
characterEncodingName:(NSString *)characterEncodingName
baseURL:(NSURL *)baseURL;
//计算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]);
}
网友评论