UITabBar的appear设置属性 --iOS

    //主题设置

    [[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tabbar-light"]];

    

NSDictionary * dict = @{

                            NSFontAttributeName : [UIFont systemFontOfSize:14],

                            NSForegroundColorAttributeName : [UIColor grayColor]

                            };

//key 定义在NSAttributedString.h

    NSDictionary * selectDict = @{NSForegroundColorAttributeName : [UIColor darkGrayColor]};

    UITabBarItem * item = [UITabBarItem appearance];

    [item setTitleTextAttributes:dict forState:UIControlStateNormal];

    [item setTitleTextAttributes:selectDict forState:UIControlStateSelected];

原文地址:https://www.cnblogs.com/PJXWang/p/5854848.html