2015-06-18 58 views
0

我该如何为字体添加样式?如何添加样式?

golabel.font = UIFont(name: "Apple SD Gothic Neo" , size: 40) 

我已经试过

golabel.font = UIFont(name: "Apple SD Gothic Neo-Thin" , size: 40) 

,但它只是直奔系统字体大小为17

回答

1

你应该代表的字体名称,如下列:

golabel.font = UIFont(名称: “AppleSDGothicNeo薄”,尺寸:40)

你可以得到的(在这个例子中“苹果SD哥特式新”)的家庭提供的字体名称:

UIFont.fontNamesForFamilyName( “苹果SD哥特式新”)

例如,在打印时,您将看到:

[AppleSDGothicNeo粗体,AppleSDGothicNeo薄, AppleSDGothicNeo,超轻, AppleSDGothicNeo正规, AppleSDGothicNeo灯,AppleSDGothicNeo介质, AppleSDGothicNeo-SemiBold]

+0

我已经尝试过第一种方式,但没有任何反应。 – tanman

+0

您是否尝试使用原始帖子中的空格?不应该有任何空间。当我在发布之前尝试使用它。 –