UITabBarItem整体设置

 

@implementation BSTabBarController

+ (void)load{
    
   UITabBarItem *item =  [UITabBarItem appearanceWhenContainedInInstancesOfClasses:@[self]];
    
        NSMutableDictionary *textAttributes = [NSMutableDictionary dictionary];
        [textAttributes setValue:[UIFont systemFontOfSize:14] forKey:NSFontAttributeName];
        [item setTitleTextAttributes:textAttributes forState:UIControlStateNormal];
        [textAttributes setValue:[UIColor blackColor] forKey:NSForegroundColorAttributeName];
         [item setTitleTextAttributes:textAttributes forState:UIControlStateSelected];
}

一个tabBarController有好几个tabBarItem, 一次性地设置外观很方便。

posted @ 2015-05-30 12:58  Emyin  阅读(454)  评论(0编辑  收藏  举报