【发布时间】:2014-10-12 12:16:08
【问题描述】:
我想知道是否有人可以帮助我解决我目前遇到的问题。我正在尝试更改UITabBar 的实际字体,我已经能够在选择文本时选择文本颜色和颜色。我到目前为止的代码在这里:
//Setting tab bar background
UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar.png"];
[[UITabBar appearance] setBackgroundImage:tabBarBackground];
//[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"selected.png"]];
// Changes Selected Image color
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:33.0/255.0 green:35.0/255.0 blue:38.0/255.0 alpha:1.0]]; //Icon colour
// Changes StateNormal text Color,
[UITabBarItem.appearance setTitleTextAttributes: @{NSForegroundColorAttributeName : [UIColor colorWithRed:214.0/255 green:69.0/255 blue:65.0/255 alpha:1.0]} forState:UIControlStateNormal]; //Colour of text when not seleted
// Changes StateSelected
UIColor *titleHighlightedColor = [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0]; //Colour of text when selected
[UITabBarItem.appearance setTitleTextAttributes: @{NSForegroundColorAttributeName : titleHighlightedColor} forState:UIControlStateSelected];
我想知道是否有人知道是否可以在此处更改字体,如果可以,我会怎么做?代码位于 AppDelegate.m
提前致谢,
哈里森
【问题讨论】:
标签: ios objective-c cocoa-touch fonts tabbar