Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 iPhone 应用程序中设置用户选择字体的可能性。
我已经使用 UIFont 类取得了进展。这是我的问题:当在字体系列中选择字体时,我如何知道用户对大小的可能性?有没有办法列出它们?我在 UIFont 文档或我在网上看到的任何地方都没有看到类似的东西。
感谢您提供任何信息。
iOS 使用可缩放字体,您可以以分数为单位指定大小。所以没有办法列出可能性。给用户一些好的选择或者一个滑块。
正如 David Dunham 所说,字体是可扩展的,因此您可以使用该[UIFont normalSystemFondOfSize:]方法访问任意大小的字体。[UIFont fontWithName:size:]如果您需要实际更改使用的字体,您也可以使用。
[UIFont normalSystemFondOfSize:]
[UIFont fontWithName:size:]