标签:字体 uitabbaritem
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],UITextAttributeTextColor, nil]forState:UIControlStateSelected];
这个时候会报警告‘UITextAttributeTextColor‘ is deprecated in iOS 7. The iOS 7 key is ‘NSForegroundColorAttributeName
然后替换一下就可以了,不过NSForegroundColorAttributeName最底支持到ios6.0
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegroundColorAttributeName, nil]forState:UIControlStateSelected];
标签:字体 uitabbaritem
原文地址:http://blog.csdn.net/xiao562994291/article/details/42522765