iOS 学习--网页视图知识点
1.webView HTML 代码的加载
NSString *str = @"公安报警电话:12110";
[webView loadHTMLString:str baseURL:nil];
2.webView URL 加载
NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
3.webView 属性识别(电话,网址,链接,地址,时间.....) webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber;
4.webView 字体大小的改变
NSString *str = [NSString stringWithFormat:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='%f%%'",slider.value];
[webView stringByEvaluatingJavaScriptFromString:str];
5.webView 背景透明化
webView.opaque = NO;