我带入Xcode的自定义TrueType字体文件在UINavigationBar中显示不正确。它显示系统字体(Helvetica Bold)而不是自定义字体。
RootViewController.m
self.title = @"Library";
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], UITextAttributeTextColor,
[UIFont fontWithName:@"adellebasic_bold.ttf" size:20.0], UITextAttributeFont,nil]];
我还确保我已经正确地将它复制到了Xcode中,并在Info.plist文件的UIAppFonts下声明了它。此外,请注意,如果我将其设置为包含在iPhone SDK中而不是自定义字体的UIFont,则该代码可以正常工作。
有没有人能想到我在这里做错了什么?