Change default font to custom fonts in whole app

前端 未结 6 1990
猫巷女王i
猫巷女王i 2020-12-30 16:54

I want to keep custom fonts in iOS app. Currently, I\'m using iOS default fonts. Is there any possible way for the same?

How do I include the custom font so that I c

6条回答
  •  青春惊慌失措
    2020-12-30 17:08

    Add your custom font into your project , i.e. Dragged the font file(CALIBRIZ_0.TTF) into XCode project.

    Edit Info.plist: Add a new entry with the key "Fonts provided by application".

    For each of your files, add the file name to this array

    Now set font to your label

    yourLabel.font = [UIFont fontWithName:@"Calibri" size:15];
    

提交回复
热议问题