How can I recreate the letterpress-like effect applied to the backbarbuttonitem in the notes app in ios 7? I tried the following:
NSShadow *textShadow = [[NSShadow alloc] init];
textShadow.shadowOffset = CGSizeMake(0.0, -1.0);
textShadow.shadowColor = [UIColor blackColor];
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:@"Back" attributes:@{NSForegroundColorAttributeName : [UIColor orangeColor], NSShadowAttributeName : textShadow}];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:attributedTitle style:UIBarButtonItemStylePlain target:nil action:nil];
But it says I can't use NSAttributedString in place of an NSString.
For iOS 5 and above, you can use the
UIAppearance
functionality to change the Text Color, Font, Tint Color etc of multiple UI Components like UITabBar, UIBarButton, etc.for UIBarButtonItem, check the below two options.
Option1: For ANY UIBarButtonItem:
Option 2: For UIBarButtonItem of a UINavigationBar ONLY:
NOTE: You can add these lines (either of the 2 options) in the .m file of AppDelegate..