IPhone 开发 代码中设置字体样式及使用方法

IPhone 所支持的字体:

  • "Courier"
  • "AppleGothic"  
  • "Arial"
  • "STHeiti TC"
  • "Hiragino Kaku Gothic ProN"
  • "Courier New"
  • "Zapfino"
  • "Arial Unicode MS"
  • "STHeiti SC"
  • "American Typewriter"
  • "Helvetica"
  • "Marker Felt"
  • "Helvetica Neue"
  • "DB LCD Temp"
  • "Verdana"
  • "Times New Roman"
  • "Georgia"
  • "STHeiti J"
  • "Arial Rounded MT Bold"
  • "Trebuchet MS"
  • "STHeiti K"

UIFont *tFont = [UIFont fontWithName:[[UIFont fontNamesForFamilyName:@"Helvetica"] objectAtIndex:N] size:17];
[textLabel setFont:tFont];

每一种FamilyName都是个Array类型的变量,N一般取0基本没有错误,如果N取其他数,且Array里没有那么多,则报错可自己尝试,IPhone字体对国字支持的不够好,基本没有太大变化,一般对英文是嘎嘎好使

你可能感兴趣的:(iPhone)