作者:残念易_138 | 来源:互联网 | 2023-08-27 16:14
NSString*title[NSStringstringWithFormat:@"<p><fontcolor\"black\"size\"4\">&
NSString *title = [NSString stringWithFormat:@"
%@
",_webTitle]; //设置webView 标题打大小和颜色 以及加粗
NSString *title = [NSString stringWithFormat:@"
%@
",_webTitle]; //设置webView 标题打大小和颜色
NSString *dataa = [NSString stringWithFormat:@"%@",data]; //让h5 图片宽度 = 320
NSString *time = [NSString stringWithFormat:@"
%@
",_time];
如果后台返回的是html的数据 不是url
NSString *filePath = [NSString stringWithFormat:@"%@\n%@\n%@",title,time,dataa];
financeWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0,0, kUIScreenWidth, kUIScreenHeight-64)];
financeWeb.delegate = self;
[financeWeb.scrollView setBounces:YES];
financeWeb.backgroundColor = [UIColor whiteColor];
[self.view addSubview:financeWeb];
[financeWeb loadHTMLString:filePath baseURL:nil];