UIWebView 更改加载内容里面的字体大小
2011-11-15 15:56
477 查看
方法一:
方法二:
改变字体颜色
以上内容来源于互联网。
- (void)webViewDidFinishLoad:(UIWebView *)webView { // finished loading, hide the activity indicator in the status bar [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [self.guideWebView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= ’150%’"]; }
方法二:
[NSString stringWithFormat:@"<html> \n" "<head> \n" "<style type=\"text/css\"> \n" "body {font-family: \"%@\"; font-size: %f; color: %@;}\n" "</style> \n" "</head> \n" "<body>%@</body> \n" "</html>", @"宋体", fontSize,fontColor,stringValue] ;
改变字体颜色
NSString *jsString = [[NSString alloc] initWithFormat:@"document.body.style.fontSize=%f;document.body.style.color=%@",fontSize,fontColor]; [webView stringByEvaluatingJavaScriptFromString:jsString]; [jsString release];
以上内容来源于互联网。
相关文章推荐
- UIWebView 更改加载内容里面的字体大小
- UIWebView 更改加载内容里面的字体大小
- android根据内容动态更改TextView的字体大小
- uiwebview加载网页后根据内容设置大小
- uiwebview 加载html时字体变小 加载前或加载后改变字体大小
- UIWebView中加载HTML的Table,td设置百分比宽度并且宽度不被里面的内容撑开
- UIWebView添加图片点击事件、调整字体大小与高度自适应的解决方法
- 字体的大小不跟随系统DPI的更改而改变的解决方案
- android studio 更改背景和设置字体大小
- Qt界面字体大小设置和更改字体
- 解决iphone横屏时字体变大问题或者内容大小不一样等...
- [置顶] mfc怎么动态加载时间以及改变字体大小和颜色。
- mfc怎么动态加载时间以及改变字体大小和颜色
- Notepad++ 怎么设置出现左边的目录结构和更改背景颜色和字体大小
- combox的二次查询功能,既动态更改combox里面的内容
- MyEclipse里更改字体大小和快捷建的设置
- 【CentOS 7】Virtual Console 更改字体及大小
- iOS 改动toolbar里面文字的字体和大小
- PDF文本框更改字体大小
- notepad++更改字体大小和颜色