如何更改 Storyboard 上的 NavigationController.title.font?
How can I change the NavigationController.title.font on the Storyboard?
现在,我使用 storyboard
来设置 UI。它是storyboard
中的一个UITableViewController
。 UITableViewController
是 UINavigationController
的 rootViewController
。现在,我设置了NavigationController
的标题,但是标题太小了。我想更改标题的字体和标题的颜色。 StoryBoard
我该怎么办。
顺便说一句,如果它不能在 storyBoard
中执行。我可以使用代码吗??
使用 StoryBoard 见下图
使用代码
在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]];
现在,我使用 storyboard
来设置 UI。它是storyboard
中的一个UITableViewController
。 UITableViewController
是 UINavigationController
的 rootViewController
。现在,我设置了NavigationController
的标题,但是标题太小了。我想更改标题的字体和标题的颜色。 StoryBoard
我该怎么办。
顺便说一句,如果它不能在 storyBoard
中执行。我可以使用代码吗??
使用 StoryBoard 见下图
使用代码
在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]];