iOS小技巧15-改变UITabBarItem 字体颜色
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//UITabBarItem字体的颜色 没有被选中的时候
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], NSForegroundColorAttributeName, nil]
forState:UIControlStateNormal];
//UITabBarItem字体的颜色 被选中的时候
[[UITabBarItem appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegroundColorAttributeName, nil]forState:UIControlStateSelected];
return YES;
}
著作权声明:本文由http://www.bestnathan.com/原创,欢迎转载分享。请尊重作者劳动,转载时保留该声明和作者博客链接,谢谢