swift UIWebView的基础用法
2018-06-07 本文已影响0人
水跃龙纹
import UIKit
import Foundation
class ViewController:UIViewController{
override funcviewDidLoad() {
super.viewDidLoad()
// 初始化
let wbView =UIWebView(frame:CGRect(x:0, y:40, width:self.view.frame.size.width, height:self.view.frame.height))
self.view.addSubview(wbView)
// 添加地址
wbView.loadRequest(URLRequest(url:URL(string:"https://www.baidu.com")!))
}
}
![](https://img.haomeiwen.com/i4111584/4bfeefd1b5d36026.png)