jiexishede
jiexishede

Reputation: 2613

How can I change the NavigationController.title.font on the Storyboard?

Now, I use the storyboard to setup the UI. It is a UITableViewController in the storyboard. The UITableViewController is the rootViewController of the UINavigationController . Now , I set the NavigationController's title, but the title is too small. I want to change the font of the title and the color of the title. How should I do in the StoryBoard. By the way, if it can't do in the storyBoard. Can I do it use code ??

Upvotes: 3

Views: 62

Answers (1)

Maulik shah
Maulik shah

Reputation: 1704

Using StoryBoard see following Image

enter image description here

using Code

Add code in view didload

 NSShadow *shadow = [NSShadow new];
[shadow setShadowColor: [UIColor clearColor]];
[shadow setShadowOffset: CGSizeMake(0.0f, 1.0f)];

[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                         [UIFont fontWithName:@"TimeBurner" size:27.0f], NSFontAttributeName,
                                         [UIColor whiteColor], NSForegroundColorAttributeName,
                                         shadow, NSShadowAttributeName,nil]];

Upvotes: 1

Related Questions