在我的项目中,我必须显示几个网页。在webView的顶部,我添加了一个UIImageView来显示标题。我已经设置了位置并且每个模式都相等。但是一页从另一页开始。 This is what simulator displays
网页浏览在概述上是相同的,就像你可以看到的那样。
import UIKit
class SprintReviewViewController: UIViewController {
@IBOutlet weak var WebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
WebView.loadRequest(NSURLRequest(URL: NSURL(fileURLWithPath:NSBundle.mainBundle().pathForResource("SprintReview", ofType: "html")!)))
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
就像你在代码中看到的那样,我对webview做了很多事情。我只更改了网址!
HTML也采用相同的风格。 第一个屏幕的HTML开始
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type = "text/css" href="CSS.css">
<h3>DAS DAILY SCRUM</h3>
</head>
<body>
<p>
<b>Zweck</b><br><br>
......
第二个屏幕的HTML开始
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type = "text/css" href="CSS.css">
<h3>SPRINT REVIEW</h3>
</head>
<body>
<p>
<b>
Zweck
</b><br><br>
我不知道如何解决这个问题。 我已经通过添加&#34;&lt;做了一点解决方法。 BR&GT;&#34;在标题之前标记,但我不喜欢这样。