How to set the font style of WebView?

I use this line of code to set the font and text size. But that does not work.

NSString * abc=@ "<html><body style=\"font-family:Verdana; font-size:12px; color:#000000;\"></body></html>"; [msgWebView setCustomTextEncodingName:abc]; 

Please let me know how I can set the font style of text in WebView.

+4
source share
1 answer

I think you are approaching him wrong. Another way:

 [[msgWebView preferences] setDefaultFontSize:12]; [[msgWebView preferences] setStandardFontFamily:@"Verdana"]; 
+3
source

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


All Articles