Cocoa WebView字体太小 [英] Cocoa WebView font too small

查看:128
本文介绍了Cocoa WebView字体太小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加一个WebView到我的应用程序时,网页的字体大小比Safari中的小很多。有什么原因吗?

When I add a WebView to my application the font size of web pages is a lot smaller than that in Safari. Is there some reason?

推荐答案

是的。如果您希望字体大小与Safari匹配,则需要将默认字体设置为16px。

Yes. You need to set the default font to 16px if you want the font size to match that of Safari. You can do this in Interface Builder.

您也可以通过编程方式进行:

You can also do it programmatically:

[[webView preferences] setDefaultFontSize:16];

这篇关于Cocoa WebView字体太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆