如何将 UI 元素的字体设置为“系统”字体 IB 中的字体?

发布于 2024-07-27 13:36:54 字数 209 浏览 1 评论 0原文

如何将 UI 元素(例如 UILabel)的字体设置为 IB 中的“系统”字体?

在代码中,我知道我可以执行以下操作:

UIFont * tempFont = [[UIFont systemFontOfSize:24] retain];

但是在 IB 中执行相同的操作怎么样? iPhone默认的系统字体是什么?

How do I set the font of an UI element (ex. UILabel) to the "System" font in IB?

In code, I know I can do the following:

UIFont * tempFont = [[UIFont systemFontOfSize:24] retain];

But what about doing the same thing in IB? What is the default system font on the IPhone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人的歌 2024-08-03 13:36:54

我认为你必须以编程方式找出(NSLog 结果),并在界面生成器中设置它。 然而,您无法确定结果是否是将来的字体。

顺便说一句,这也可能是一个有用的网站:http://daringfireball。净/misc/2007/07/iphone-osx-fonts

I think you have to find out programmatically (NSLog the result), and set that in interface builder. You won't be sure that the result will be the font in the future however.

By the way, this might be a useful site too: http://daringfireball.net/misc/2007/07/iphone-osx-fonts

放赐 2024-08-03 13:36:54

本身没有默认的系统字体,因为它取决于手机设置的语言。 在使用拉丁字符的地方几乎都使用 Helvetica,但当拉丁字符集不够时,可以轻松地用另一种字体替代。 systemFontOfSize 允许操作系统使用相关语言的系统字体。

There is no default system font, per se, because it's dependent upon the language the phone is set to. Helvetica is used pretty much wherever Latin characters are used, but another font could be easily substituted when the Latin character set won't suffice. systemFontOfSize allows the OS to use the system font for the language in question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文