Frage

I set custom font for all labels via appearance proxy in App delegate. Like this [[UILabel appearance] setFont:[UIFont fontWithName:@"Open Sans" size:18.0]];

But now I struggle with a problem: I can't set font size via Interface Builder (if I set it, nothing will change and appearance proxy settings will be applied). I only want to set a font name, but to have an ability to change font size in IB.

Does anyone know how to fix it OR workaround it?

Any help is appreciated.

War es hilfreich?

Lösung

IB font settings won't work if you're overriding them via appearance proxy. You'll have to set the other fonts in code, there's no workaround for this. If you have a ton of labels that need to have their fonts changed in the scope of the same view cotnroller, you can create an outlet collection with them and loop through them in viewDidLoad method.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top