External proxy server does not work as intended for UIButton font

im is currently developing my application through the appearance proxy, and I ran into this problem: when I set the properties to the appearance of UIButton, my font is ignored:

[buttonAppearance setTitleColor:darkColor forState:UIControlStateNormal]; [buttonAppearance.titleLabel setFont:[UIFont fontWithName:@"Helvetica Neue" size:10.0]]; 

the first line is applied correctly (darkColor - some UIColor), but my font change is completely ignored. When I copy a line to my ViewController and apply it to a specific button, it works fine.

Am I missing something?

any help appreciated! tee

0
ios uibutton uiappearance
Jun 15 '13 at 21:11
source share
2 answers

The wrong font name should be HelveticaNeue , with no space between them.

In the future, if you want to see other iOS font names, you should check out this code snippet

EDIT

After a closer look, I realized that you are trying to set the appearance of the button name, which is UILabel , unfortunately UILabel does not have a font property in the UIAppearance and why the font does not work.

+3
Jun 15 '13 at 22:35
source share

I found this class TWTButton.h , which solved my problems by adding a new selection class [setTitleFont:] to the UIButton class.

 buttonAppearance = [TWTButton appearance]; [buttonAppearance setTitleFont:[UIFont systemFontOfSize:10.0f]]; 

You can read more about this here: http://toastmo.com/blog/2013/01/17/uiappearance/

+1
Jan 28 '14 at 16:54
source share



All Articles