简体   繁体   中英

Font bold issue in iphone

I have a label and i want make its font bold pragmatically.
I am trying this code.

[label1 setFont: [UIFont fontWithName:@"Helvetica LT Compressed" size:14.0 ]];

Please give me suggestion.

Try this:

[label1 boldSystemFontOfSize:14.0];

Hope this helps you.

您将必须使用该字体的粗体,

[label setFont:[UIFont fontWithName:@"Helvetica-Bold" size :34];

Please try this.

label1.font = [UIFont boldSystemFontOfSize:14];
label1.font = [UIFont fontWithName:@"Helvetica LT Compressed" size:14];

Bold fonts have another name that regular or italic ones.

If you want to know the exact name of a font, I suggest you to download the "Fonts" iphone application, on the appStore. It's free and it references every possible font that your phone handle.

It's not my app, it just an app that every iphone developer should have.

...and for helvetica, you have :

  • @"Helvetica"
  • @"Helvetica-Bold"
  • @"Helvetica-BoldOblique"
  • @"Helvetica-Oblique"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM