Created
May 31, 2014 22:02
-
-
Save mdznr/b895c66c231dacdaeed9 to your computer and use it in GitHub Desktop.
An example of how to customize the appearance of `UIBarButtonItem` for @manolosavi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[[UIImage imageNamed:@"IMG"] resizableImageWithCapInsets:UIEdgeInsetsMake(4, 4, 4, 4)] | |
forState:UIControlStateNormal | |
barMetrics:UIBarMetricsDefault]; | |
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"Courier" size:16], | |
NSForegroundColorAttributeName: [UIColor redColor]} | |
forState:UIControlStateNormal]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just because it took me a while to translate that into Swift, and it seems like I finally figured it out, here it is: