如何为字体添加样式?
golabel.font = UIFont(name: "Apple SD Gothic Neo" , size: 40)
我试过了
golabel.font = UIFont(name: "Apple SD Gothic Neo-Thin" , size: 40)
但它直接进入了 17 号的系统字体。
最佳答案
你应该像下面这样表示字体名称:
golabel.font = UIFont(name: "AppleSDGothicNeo-Thin" , size: 40)
您可以获得可用的字体名称(在此示例中为“Apple SD Gothic Neo”):
UIFont.fontNamesForFamilyName("Apple SD Gothic Neo")
例如,打印时,您将看到:
[AppleSDGothicNeo-Bold, AppleSDGothicNeo-Thin, AppleSDGothicNeo-UltraLight, AppleSDGothicNeo-Regular, AppleSDGothicNeo-Light, AppleSDGothicNeo-Medium, AppleSDGothicNeo-SemiBold]
关于ios - 如何添加样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30924146/