自定义字体在iOS 5中不起作用

Gur*_*uru 1 iphone uifont ipad ios ios5

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

titleLabel.font = [UIFont fontWithName:@"Avenir-Next-LT-Pro-Demi-Condensed_5186" size:10];
Run Code Online (Sandbox Code Playgroud)

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

Rav*_*ran 7

试试这个 ,

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..
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

titleLabel.font = [UIFont fontWithName:@"Avenir Next LT Pro" size:10];
Run Code Online (Sandbox Code Playgroud)