UILabel - 设置自定义字体 [英] UILabel - set custom fonts

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

问题描述

我想将GillSans-Bold字体添加到UILabel。
我已经在xib文件中设置了它,我也在我的课程中设置如下:

I want to add GillSans-Bold font to a UILabel. I have set it in the xib file , and I'm also setting it up in my class as follows :

[label setFont:[UIFont fontWithName:@"GillSans-Bold" size:18]];

但是,它似乎对我不起作用。
有什么建议吗?

But , it doesn't seem to work for me. Any suggestions ?

推荐答案

为了实现这个目的,我必须在我的项目目录中添加这个字体,并添加Info.Plist文件中的这个字体

For this to be working I had to add this font in my project directory , and added this font in the Info.Plist file

这篇关于UILabel - 设置自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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