【发布时间】:2016-08-29 01:40:49
【问题描述】:
我试图在 WkWebView 中显示一个我之前下载并存储在字符串中的 html 页面。
这就是我设置 WkWebView 的方式:
webView = WKWebView(frame: self.blankView.frame)
webView.navigationDelegate = self
webView.loadHTMLString(tipShow.htmlString!, baseURL: nil)
view.addSubview(webView)
我要显示的 html 字符串是:
<html> <style type="text/css"> * { -webkit-touch-callout: none; -webkit-user-select: none; /*
Disable selection/copy in UIWebView */
}
</style> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,
initial-scale=1">
<title>TITLE</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script
src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> </head>
<body>
<div data-role="page" id="page1">
<div align=justify style="margin-left:20px; margin-right:20px">
<font size="4.5" face="HelveticaNeue-Light"><br>
<p>
THIS IS A TEST
</p>
</div> </div>
</body></html>
当 WkWebView 在我的视图中显示时,它永远是这样的。
谁能解释一下为什么以及如何解决这个问题?
【问题讨论】:
标签: ios iphone swift ios9 wkwebview