Sam Jarman Sam Jarman - 1 year ago 79
iOS Question

Set a default font for whole iOS app?

I have a custom font I want to use for everything displaying text in my app, labels, text views etc.

IS there a way to set the default font (labels by default use SystemFont) for the whole app?

Answer Source

It seems to be possible in iOS 5 using the UIAppearance proxy.

 [[UILabel appearance] setFont:[UIFont fontWithName:@"YourFontName" size:17.0]];

That will set the font to be whatever your custom font is for all UILabels in your app. You'll need to repeat it for each control (UIButton, UILabel, etc.).

Remember you'll need to put the UIAppFonts value in your info.plist and include the name of the font you're including.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download