The font looks like smaller in WKWebView than in UIWebView(WKWebView 中的字体看起来比 UIWebView 中的小)
本文介绍了WKWebView 中的字体看起来比 UIWebView 中的小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 UIWebView
更改为 WKWebView
,但是,使用相同的 html,WKWebView
中的字体看起来比 UIWebView 中的字体小.我不希望这种情况发生,那么有什么办法可以避免这种变化吗?
I changed UIWebView
to WKWebView
, however, with the same html, the font in WKWebView
looks like smaller than in UIWebView
. I don't want this happen, so is there any way to avoid this change?
推荐答案
最后我通过添加一个html字符串解决了这个问题:
Finally I solved this problem by adding an html string:
- 对于 Objective-C:
- 对于 Swift:
另外,如果你想加载 url 而不是 html 你可以试试:
What's more,if you want to load url rather than html you can try:
这篇关于WKWebView 中的字体看起来比 UIWebView 中的小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!