在UITabBarItem中如何更改文本的颜色。默认情况下,文本出现在whiteColor中。我想改成黑色,怎么做?
答案 0 :(得分:0)
在ViewController.m中
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
[self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor greenColor],UITextAttributeTextColor,nil] forState:UIControlStateNormal];
}
return self;
}