Simply use the Swift Webview

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)
    // 下面一行代码意思是充满的意思(一定要加,不然也会显示有问题)
    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.
}

}

When Autoresize Subviews then selected, view automatically resizes the subclass, if not checked or can not fully fill out the screen page content

Simply use the Swift Webview

App video production QQ: 2117469287, works: www.che960.cn

Guess you like

Origin blog.51cto.com/9465472/2408488