设置UITabBarItem和UIBarButtonItem字体颜色

来源:互联网 发布:ios10蜂窝数据开关在哪 编辑:程序博客网 时间:2024/05/17 04:53

由于系统会自动渲染,所以要使字体颜色达到自己想要的效果,可以有下面这种方法

 NSMutableDictionary *textattri=[NSMutableDictionarydictionary];

    textattri[NSForegroundColorAttributeName]=SLColor(123,123, 123);

    NSMutableDictionary *selecttextattri=[NSMutableDictionarydictionary];

    selecttextattri[NSForegroundColorAttributeName]=[UIColororangeColor];




UIBarButtonItem *item=[UIBarButtonItemappearance];

    NSMutableDictionary *textattri=[NSMutableDictionarydictionary];

    textattri[NSForegroundColorAttributeName]=SLColor(123,123, 123);

    NSMutableDictionary *selecttextattri=[NSMutableDictionarydictionary];

    selecttextattri[NSForegroundColorAttributeName]=[UIColororangeColor];







0 0