// 设置文字的样式
NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
textAttrs[NSForegroundColorAttributeName] = [UIColor colorWithRed:0.859 green:0.867 blue:0.192 alpha:1.000];
NSMutableDictionary *selectTextAttrs = [NSMutableDictionary dictionary];
selectTextAttrs[NSForegroundColorAttributeName] = [UIColor colorWithRed:0.839 green:0.824 blue:0.282 alpha:1.000];
[[UITabBarItem appearance] setTitleTextAttributes:textAttrs forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:selectTextAttrs forState:UIControlStateSelected];
本文详细介绍了如何使用Objective-C代码为iOS TabBar栏设置文字样式,包括正常状态和选中状态的颜色调整。
1万+

被折叠的 条评论
为什么被折叠?



