iOS tabbarItem的颜色都是白色,点击其中一个,其他的不变,没有点中的效果

来源:互联网 发布:音乐解析软件手机软件 编辑:程序博客网 时间:2024/04/30 03:52

 //未被选中的图片效果不变

    [navigtion.tabBarItemsetTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorwhiteColor], NSForegroundColorAttributeName,nil] forState:UIControlStateNormal];

    navigtion.tabBarItem.image = [[UIImageimageNamed:@"imageName"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];


//设置tabbarIten的字体颜色

//在tabBarViewCOntroller里

self.tabBar.tintColor =颜色;



1 0