設置UITabBarItem和UIBarButtonItem字體顏色

由於系統會自動渲染,所以要使字體顏色達到自己想要的效果,可以有下面這種方法

 NSMutableDictionary *textattri=[NSMutableDictionary dictionary];

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

    NSMutableDictionary *selecttextattri=[NSMutableDictionary dictionary];

    selecttextattri[NSForegroundColorAttributeName]=[UIColor orangeColor];




UIBarButtonItem *item=[UIBarButtonItem appearance];

    NSMutableDictionary *textattri=[NSMutableDictionary dictionary];

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

    NSMutableDictionary *selecttextattri=[NSMutableDictionary dictionary];

    selecttextattri[NSForegroundColorAttributeName]=[UIColor orangeColor];







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章