OpenSans font not working in iOS simulator

前端 未结 1 888
我寻月下人不归
我寻月下人不归 2020-12-20 13:15

I\'d like to use the OpenSans font on a UILabel, but it\'s not showing up in the iOS simulator. All that appears is the default system font. I have:

1)

相关标签:
1条回答
  • 2020-12-20 13:33

    Fixed it, it was because of this minor error.

    self.itemPrice.font = [UIFont fontWithName:@"OpenSans-Extrabold" size:13.0f];
    

    Extrabold, not ExtraBold. I opened up Font Viewer, as recommended, and it showed that under PostScript Name.

    I have now used #define's to place a font string name in there and use that throughout my application to avoid user error and literal strings in the middle of my code.

    0 讨论(0)
提交回复
热议问题