开发者

UIButton with a ttf font

Is it possible to use UIButtons with my own true type font? I found the FontLabel open source that can use ttf with UILabels, but unfortunately I can't set my UIButton's titleLabel to a created FontLabel开发者_Go百科. Can someone offer a simple solution to this? Or should I just not be using UIButtons altogether and instead use something else? I feel like I'm missing something obvious because I can't imagine there wouldn't be some truetype functionality in some default button offering.


As of the 3.2 SDK, you can include your own ttf fonts in your app. Just include the font file in your bundle and add the UIAppFonts key to your info.plist. (http://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW18)

You should then be able to create the font as you would any built-in font and use it as the font for your button's label.


For those of you having this problem and looking for a workaround, this worked for me (link to a question I posed and later answered):

Advice on Debugging a UIAppFonts Issue on iPad

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜