UILabel - setting font - typeface programmatically in iPhone

后端 未结 6 960
谎友^
谎友^ 2020-12-05 02:40

I have following code in my Application.

tmp=[[UILabel alloc] initWithFrame:label1Frame];
tmp.tag=1;
tmp.textColor=[UIColor blackColor];
[tmp setFont:[UIFont         


        
6条回答
  •  遥遥无期
    2020-12-05 03:30

    You will need to use the name of the bold font within the family. To find out if there is a bold version of American Typewriter, try outputting

    [UIFont fontNamesForFamilyName:@"AmericanTypewriter"] 
    

    to the console.

    In this case, you should use "AmericanTypewriter-Bold".

    [UIFont fontNamesForFamilyName:@"AmericanTypewriter-Bold"] 
    

提交回复
热议问题