According to the documentation, the titleTextAttributes
of UINavigationBar
only lets you specify the font, text color, text shadow color, and text shadow offset.
If you want to use other attributes, you can create a UILabel
with the NSAttributedString
you want, and set it as the titleView
for your controller's navigationItem
For example:
UILabel *titleLabel = [UILabel new];
NSDictionary *attributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],
NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Light" size:20.0],
NSKernAttributeName: @2};
titleLabel.attributedText = [[NSAttributedString alloc] initWithString:self.navigationItem.title attributes:attributes];
[titleLabel sizeToFit];
self.navigationItem.titleView = titleLabel;