标签:style blog http io ar color os 使用 sp
UIWebView是IOS中用于展示Web页面的基本控件,提供了非常简便高效的使用方式.
首先,要现在storyboard中建立一个UIWebView的IBOutlet,且与ViewController关联起来.
然后就是代码执行过程了:
//webView与storyboard连接起来 var webView: UIWebView!
//先设置好webView的样式等 webView!.frame = self.view.frame webView!.backgroundColor = UIColor.grayColor() //添加webView到self.view中,然后再装载urlRequest。 self.view.addSubview(webView) var url = "http://www.dianping.com" urlRequest = NSURLRequest(URL: NSURL(string: url)!) webView!.loadRequest(urlRequest)
此外,还有一些更加高级的功能,如WebView的高级特性,添加Web的更多导航功能等.暂时未记录,以后用到之后再补上来吧.
标签:style blog http io ar color os 使用 sp
原文地址:http://blog.csdn.net/icetime17/article/details/41805033