您好,登錄后才能下訂單哦!
import UIKit
import WebKit
class MeHelpDetailController: UIViewController {
@IBOutlet weak var webContainerView: UIView!
var url = "http://www.mapway.online:8090/lvtu/web/help/make.html"
var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
webView = WKWebView(frame: webContainerView.frame)
// 下面一行代碼意思是充滿的意思(一定要加,不然也會(huì)顯示有問題)
webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
webContainerView.addSubview(webView)
let mapwayURL = URL(string: url)!
let mapwayRequest = URLRequest(url: mapwayURL)
webView.load(mapwayRequest)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
當(dāng)Autoresize Subviews被選擇的話,view會(huì)自動(dòng)調(diào)整子類的大小,如果不勾選可能會(huì)填充不完全或者頁(yè)面內(nèi)容在屏幕外
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。