The question is plain easy and simple, the answer unfortunately not.
How can you change the font of the text in the UINavigationBar
?
In the Safari app , you can choose the layout that works best for you. Depending on the layout, the search field appears at the top (Single Tab layout) or bottom (Tab Bar layout) of the screen. Go to Settings > Safari, then scroll down to Tabs. Select either Tab Bar or Single Tab.
If you wanted to change the font in the Interface Builder itself (without any code) here is the way to do it in Xcode6:
1.) Find the Navigation Bar view under the Navigation Controller Scene
2.) Change the Title Font, Color and Shadow attributes in the Attributes Inspector.
From iOS 7 and later:
NSShadow* shadow = [NSShadow new]; shadow.shadowOffset = CGSizeMake(0.0f, 1.0f); shadow.shadowColor = [UIColor redColor]; [[UINavigationBar appearance] setTitleTextAttributes: @{ NSForegroundColorAttributeName: [UIColor greenColor], NSFontAttributeName: [UIFont fontWithName:@"Helvetica" size:20.0f], NSShadowAttributeName: shadow }];
From iOS 5 and later:
[[UINavigationBar appearance] setTitleTextAttributes: @{ UITextAttributeTextColor: [UIColor greenColor], UITextAttributeTextShadowColor: [UIColor redColor], UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)], UITextAttributeFont: [UIFont fontWithName:@"Helvetica" size:20.0f] }];
Earlier than iOS 5:
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 400, 44)]; label.backgroundColor = [UIColor clearColor]; label.font = [UIFont boldSystemFontOfSize:20.0]; label.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5]; label.textAlignment = UITextAlignmentCenter; label.textColor =[UIColor whiteColor]; label.text=self.title; self.navigationItem.titleView = label; [label release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With