NSMutableDictionary *textAttr = [NSMutableDictionary dictionary];
textAttr[NSForegroundColorAttributeName] = [UIColor whiteColor];
[[UITabBarItem appearance]setTitleTextAttributes:textAttr forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:textAttr forState:UIControlStateSelected];
上面的代码就是修改TabBarItem字体的颜色。
不过注意的是:不能够用self.tabBarItem修改字体颜色之类的值,必须要用[UITabBarItem appearance];否则修改不成功。