• 利用UI_APPEARANCE统一设置UITabBarItem样式


    -(void)setupTabBarItemAttributes{
        
        //attributes
        NSMutableDictionary *selectedAttrs= [NSMutableDictionary dictionary];
        selectedAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:10];//label字体大小
        selectedAttrs[NSForegroundColorAttributeName] = [UIColor orangeColor];//选中字体颜色
        NSMutableDictionary *attrs= [NSMutableDictionary dictionary];
        attrs[NSFontAttributeName] = selectedAttrs[NSFontAttributeName];
        attrs[NSForegroundColorAttributeName] = [UIColor lightGrayColor];//未选中字体颜色
        
        UITabBarItem *item=[UITabBarItem appearance];
        [item setTitleTextAttributes:attrs forState:UIControlStateNormal];
        [item setTitleTextAttributes:selectedAttrs forState:UIControlStateSelected];
    }
  • 相关阅读:
    Arrays工具类、二维数组
    Idea软件的使用
    循环语句
    方法
    objective-C 2.0
    Unix系统常用命令
    文献管理工具Zotero
    如何降低论文重复率
    SQL易忽视的细节
    数据库系统原理学习资源
  • 原文地址:https://www.cnblogs.com/oshushu/p/5584521.html
Copyright © 2020-2023  润新知