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")!))

    }

}

上一篇 下一篇

猜你喜欢

热点阅读