How to set custom font in UIWebView?

I have a font in resources and I uploaded it to UIFont

I want to know how to use this UIFont as the default font for my UIWebView

Thanks in advance...

+3
source share
2 answers

If you use a webpage to display in a webview

Here is what I would do:

  • Create an HTML page title bar add a css file or inline CSS to the header
  • Create an HTML body.
  • HTML Finite Elements

Add all rows and load WebView from row

NSString *bundlepath = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:bundlepath];
[webView loadHTMLString:html baseURL:baseURL];
+2
source

Source: https://habr.com/ru/post/1765979/


All Articles