如何将字体设置为粗体
[cell.itemContentWebView loadHTMLString:[NSString stringWithFormat"<div style='font-family:-apple-system','HelveticaNeue-Bold; style='font-size:24px;'>%@",object.title] baseURL:nil];
Rafay 回答你的问题
- (void)webViewDidFinishLoadUIWebView *)webView
{
//Font size
int fontSize = 80;
NSString *jsString = [[NSString alloc] initWithFormat"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '%d%%'", fontSize];
[webview stringByEvaluatingJavaScriptFromString:jsString];
//Font Family Style - Bold
NSString *jsWebViewFontFamilyString = [[NSString alloc] initWithFormat"document.getElementsByTagName('body')[0].style.fontFamily = 'HelveticaNeue-Bold'"];
[webview stringByEvaluatingJavaScriptFromString:jsWebViewFontFamilyString];
//Font Color or web view text color
[webview stringByEvaluatingJavaScriptFromString"document.getElementsByTagName('body')[0].style.color = 'Green'"];
}
关于html - 在 iOS 中使 UIWebview 的字体加粗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33417158/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |