I want to set font of tabBar
title as ubuntu but I can't set that.
I write below code for that:
self.tabBarController.navigationController.navigationBar.titleTextAttributes =
@{NSForegroundColorAttributeName: [UIColor whiteColor],
NSFontAttributeName:[UIFont fontWithName:@"Ubuntu" size:9.0f]};
Objective C Code-
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"your_font_name" size:20.0f], NSFontAttributeName, nil] forState:UIControlStateNormal];
Swift Code-
UITabBarItem.appearance().setTitleTextAttributes(
[NSFontAttributeName: UIFont(name:"your_font_name", size:11)!,
NSForegroundColorAttributeName: UIColor(rgb: 0x929292)],
forState: .Normal)
For more refrence- iOS5 TabBar Fonts and Color
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