开发者

How to chage the Color of text in UITabBarItem?

开发者 https://www.devze.com 2023-03-01 01:27 出处:网络
In UITabBarItem how to change the开发者_C百科 color of text..By default the text is appearing in whiteColor. I want to change to black, how to do it?

In UITabBarItem how to change the开发者_C百科 color of text..By default the text is appearing in whiteColor. I want to change to black, how to do it?


In 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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消