UILabel font : bold and italic [duplicate]

谁说我不能喝 提交于 2019-12-20 13:37:47

问题


Possible Duplicate:
How do I set bold and italic on UILabel of iPhone/iPad?

I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code,

lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; 

or

lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];

I want my font Bold and Italic both. Can anyone help me? Thank you in advance.


回答1:


try this code...

UIFont *yourFont = [UIFont fontWithName:@"Helvetica-BoldOblique" 
                                   size:[UIFont systemFontSize]];
lblTitle.font = yourFont;

you can use also another fontName for BoldItalik like.

Optima-BoldItalic,TimesNewRomanPS-BoldItalicMT,Baskerville-BoldItalic,HelveticaNeue-BoldItalic,etc...




回答2:


There are several font that contains Bod+Italic in themselves you can use those fonts... One frequently for an example is

lblTitle.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:16.0f];

others are :

- TrebuchetMS-Bold

- Helvetica-BoldOblique

- This link will help you.



来源:https://stackoverflow.com/questions/14019441/uilabel-font-bold-and-italic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!