setTitleTextAttributes on UIBarButtonItem appearance proxy for different styles
Asked Answered
S

0

6

I would like to style my UIBarButtonItems with a custom font. I am using the appearance proxy on UIBarButtonItem's titleTextAttributes to accomplish this successfully. However, I would like to set different font styles for different UIBarButtonItem styles (i.e. Medium for style Bordered, Bold for style Done).

Here is what I'm doing at the moment:

  //Navigation Items


NSDictionary *normalAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                    [UIFont myCustomLabelWithSize:18.0f], NSFontAttributeName,
                                    nil
                                    ];
  [[UIBarButtonItem appearance] setTitleTextAttributes:normalAttributes
                                              forState:UIControlStateNormal];

What would be great is if there was a setTitleTextAttribues:forState:style...

How can I accomplish this, preferable while still using the appearance proxy?

Slag answered 6/3, 2014 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.