我有一个 TabBar。我正在尝试对其进行样式设置,以使 TabBarItems 上的标题在正常状态和选定状态下具有不同的字体。对于正常状态,我想要 Helvetica Neue Light 字体,对于选定状态,我想要 Helvetica Neue Medium 字体。无论我做什么,似乎都不能让这两个状态下的字体< strong>不同。颜色更改很好用。这是我目前的设置:
// Set the tab bar title appearance for normal state.
[[UITabBarItem appearance] setTitleTextAttributes:@{
NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Light"
size:16],
NSForegroundColorAttributeName: [CMK8Colors grayColor]
}
forState:UIControlStateNormal];
// Set the tab bar title appearance for selected state.
[[UITabBarItem appearance] setTitleTextAttributes:@{
NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-Medium"
size:16],
NSForegroundColorAttributeName: [CMK8Colors blueColor]
}
forState:UIControlStateSelected];
请帮忙。