自定义字体在iOS 5中不起作用 [英] Custom Font not working in iOS 5

查看:90
本文介绍了自定义字体在iOS 5中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的资源中添加了 Avenir-Next-LT-Pro-Demi-Condensed_5186.ttf 字体。同样添加到我的info.plist中的应用程序提供的字体。
在我的代码中,我设置了这样的字体,

I have added Avenir-Next-LT-Pro-Demi-Condensed_5186.ttf font in my resources. Also added the same to Fonts provided by application in my info.plist. In my code I have set the font like this,

titleLabel.font = [UIFont fontWithName:@"Avenir-Next-LT-Pro-Demi-Condensed_5186" size:10];

但这不适用于ios 5模拟器和设备。

But this is not working in ios 5 simulators and devices.

推荐答案

试试这个,

The font name is not the font file name 

Avenir-Next-LT-Pro-Demi-Condensed_5186.ttf is a file name. simply double click the Avenir-Next-LT-Pro-Demi-Condensed_5186.ttf file it will automatically  open the font reader.Get the font name from top of the font reader navigation bar..

titleLabel.font = [UIFont fontWithName:@"Avenir Next LT Pro" size:10];

这篇关于自定义字体在iOS 5中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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