You can find supported font families in the system using the method we learned in How to add custom fonts to iOS app. You can use any fonts that bundle with an iOS system. The default font might change in the future, so you shouldn't rely on this fact. The default font for text renders in WKWebView is Times New Roman. The result is a text render in Times New Roman with a size of 36px. If you know a better way, please let me know □). All of that means to align our text at the center (It's 2021, I think we might have a better way to do a center alignment. You can ignore most of the CSS rules here. loadHTMLString (htmlString, baseURL : nil ) loadHTMLString (htmlString, baseURL : nil ) Default font familyīy default, if you don't specify a font family in CSS, iOS will use the default font, which is "Times New Roman". Here is how we present HTML string wihtin WKWebView using. We will learn how to use custom fonts in a HTML loaded using. We have learned that in How to add custom fonts to iOS app, but you might not be aware that we can also use a custom font in WKWebView.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |