In some cases, webview is used in the application to load large sections of text, but also with a variety of labels.
You can't filter it all out, and then the content loses the format that you wanted to express.
However, if WebView does not include the title of the content or other miscellaneous items into that large piece of content, it is stored separately in another field in the dictionary, and is now plain text without any labels.
and the final page needs to show the content at the same time, so the situation is more embarrassing.
The next scenario can alleviate this embarrassment:
First introduce the implementation of ideas: ScrollView Plus on the self.view stained screen, the top of the ScrollView set aside a blank for the title and other content, the following with WebView occupied the rest of the area, for loading large paragraphs of text. This allows you to customize the title of your own webview.
But the problem comes, webview itself can be sliding, while the ScrollView can also slide, so the following situation will appear: Sliding WebView when the title part of the move, webview sliding to the end, the title view can slide, which gives a very uncomfortable feeling.
How can we let the title follow the WebView slide? That is to set the webView.scrollView.scrollEnable to False, do not let webview slide, so that you can solve the previous problem.
However, the pit is one after the other, if this is set, the problem is webview and scrollview.contentsize how to set it? Don't worry, this question can be referred to "how Swift obtains WebView's content height"
Well, to make your webview headlines, these preparations will allow you to focus on your headline design.
Swift's custom title for your WebView