Is it possible to either change the font of the back button text, or hide the text and show just the icon? Setting navBarTextFontFamily changes the font of the title, but not the back button text.
I know it's possible to hide the back button text natively. See http://justabeech.com/2014/02/24/empty-back-button-on-ios7/
set backButtonTitle to ''
You can take advantage of UIAppearance to change font of UIBarButtonItem in RCCNavigationController for iOS. Just put code below in didFinishLaunchingWithOptions.
[[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[RCCNavigationController class]]] setTitleTextAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"family" size:15]} forState:UIControlStateNormal];
Awesome! This is exactly what I was looking for.
@cskaynar I'm just now getting the chance to try implementing this. I'm getting an error: Unknown receiver 'RCCNavigationController'. What do I need to include in my AppDelegate to get this to work?
Nevermind, I figured it out. You need to add this line:
#import "RCCNavigationController"
@jtibbertsma Hi! Did you have a way to push to native view controller?Thanks !
@zhaiyjgithub You mean have different back button fonts on screen by screen basis? No, I set it globally as per cskaynar's post
@guyca @yogevbd
hey guys.
This is should be in the fontFamily option, inside backButton(iOS specific options) object.
am I right?
Most helpful comment
set
backButtonTitleto''