【发布时间】:2014-10-03 18:33:50
【问题描述】:
我有一个 TabBar。我正在尝试对其进行样式设置,以便 TabBarItems 上的标题对于正常状态和选定状态具有不同的字体。对于正常状态,我想要 Helvetica Neue Light,对于选定状态,我想要 Helvetica Neue Medium。无论我做什么,我似乎都无法让这两个州的字体不同。变色效果很好。这是我目前拥有的:
// 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];
请帮忙。
【问题讨论】:
标签: ios uitabbar uitabbaritem