美文网首页
IOS tabbarItem 文字颜色,背景颜色设置方法

IOS tabbarItem 文字颜色,背景颜色设置方法

作者: JakieZhang | 来源:发表于2016-11-22 09:30 被阅读25次

设置文字颜色使用下边方法:

[[UITabBarItemappearance]setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorredColor],NSForegroundColorAttributeName,nil]forState:UIControlStateSelected];

设置不同状态中的图片,使用的方法

self.tabBarItem.image= [[UIImageimageNamed:@"tab_home"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

self.tabBarItem.selectedImage= [[UIImageimageNamed:@"tab_home-s"]imageWithRenderingMode:

相关文章

网友评论

      本文标题:IOS tabbarItem 文字颜色,背景颜色设置方法

      本文链接:https://www.haomeiwen.com/subject/exsppttx.html