【发布时间】:2019-12-16 20:27:02
【问题描述】:
谁能帮我去除带有曲面屏幕的 iPhone 底部的空白区域。比如 iPhone XS Max?
下面的代码会在底部留下一个空白的白色丑陋栏,我被卡住了。
我看过这里,找不到任何帮助。
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
var webView: WKWebView!
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let myURL = URL(string:"https://google.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
}
预计底部没有白条,页面一直延伸到底部。
【问题讨论】:
-
代码正确!更改网址并检查。我已经检查过
let myURL = URL(string:"https://apple.com")