您的位置:首页 > 产品设计 > UI/UE

iOS小技巧15-改变UITabBarItem 字体颜色

2015-12-24 11:59 411 查看

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/原创,欢迎转载分享。请尊重作者劳动,转载时保留该声明和作者博客链接,谢谢
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: