UILabel Font Problem
how can i achieve开发者_JS百科 font like this as shown in image.
BTW, iOS does offer custom ttf font support. You drag the fonts into your resources folder, and put a UIAppFonts array key in your info.plist, with the names of the font files. You don't get IB integration but you can call
[UIFont fontWithName:@"MyFontName" size:mysize];
where the name is the name of the font as seen when you open the ttf font viewer on the .ttf file. iOS also does offer shadowOffsets on labels.
But certainly, such a highly custom look is mostly likely done with images.
You can also use FontLabel check it out here - https://github.com/zynga/FontLabel
By creating a custom control inheriting UIView. By implementing drawRect: and using image sprites for each Digit you can achieve this rendering. It is not that hard to do and there are many tutorials on the web.
Even with a ttf custom font you would not obtain these gradients and shadows. Another alternative but heavier and intended to games is cocos2d iOS framework which offers truetype font support.
精彩评论