原來我們通常這樣設(shè)置導(dǎo)航欄、tablebar顏色
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
attrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
attrs[NSForegroundColorAttributeName] = [UIColor grayColor];
NSMutableDictionary *selAttrs = [NSMutableDictionary dictionary];
selAttrs[NSFontAttributeName] = attrs[NSFontAttributeName];
selAttrs[NSForegroundColorAttributeName] = [UIColor lightGrayColor];
UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:attrs forState:UIControlStateNormal];
[item setTitleTextAttributes:selAttrs forState: UIControlStateDisabled];
但是發(fā)現(xiàn)
[item setTitleTextAttributes:sforState:UIControlStateDisabled]苛谷;
毫無作用讹躯,就跟不存在一樣顶考,而
[item setTitleTextAttributes: forState:UIControlStateNormal];
卻是好用的··但是永遠(yuǎn)失去了不可用狀態(tài)的顏色效果
最后經(jīng)過研究凌唬,發(fā)現(xiàn)解決方法不再是設(shè)置
[item appearance];
而是設(shè)置
[UITabBar appearance];
[UINavigationBar appearance];
的TintColor并齐,應(yīng)該是新版本更改了api。