iphone - 无法在 UIButton 中使用自定义字体

标签 iphone ios uibutton uifont

我想在我的应用程序中使用自定义字体,它是 ttf 格式。在项目设置中,我添加了如下所示的字体名称。

enter image description here

我已经在我的资源文件夹中添加了该字体,如下所示

enter image description here

我正在尝试使用的字体是这个enter image description here

_enterButton.titleLabel.font =  [UIFont fontWithName:@"Venus Rising" size:45.0];

如果我使用 Arial 或其他一些字体,它工作正常。但是当我尝试使用这种字体时,它根本不起作用。谁能告诉我为什么??

最佳答案

我下载了字体,我认为它的名称与文件的名称不同。看看这张图片。

enter image description here

另外不要忘记将名称添加到应用程序的 Info.plist 中,在键“应用程序提供的字体”下。希望能帮助到你! :)

关于iphone - 无法在 UIButton 中使用自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11519376/

相关文章:

iphone - Xcode 看不到我的 iOS 设备,但 iTunes 可以

iphone - 如何在iphone开发环境中通过ID获取uicontrol

IOS sprite kit didBeginContact 未调用

ios - 无法从自定义动态框架访问类(Swift)

iphone - 你如何设计 iOS 组件的样式?

iphone - 单击 objective-c 中的按钮更改图像

iphone - mfmailcomposer发送邮件的邮件大小限制是多少

iphone - 如何在 UISegmentedControl 中为图像制作图像插图?

iphone - phonegap 中#import "PhoneGapDelegate.h"错误消息?

ios - Swift - 应用程序内的深层链接以启动弹出 View Controller