设置底部标题点击时的颜色
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil] forState:UIControlStateNormal];
UIColor *titleHighlightedColor = [UIColor whiteColor];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:titleHighlightedColor, NSForegroundColorAttributeName,nil] forState:UIControlStateSelected];
设置tabbar选中颜色
iOS7设置如下:
[self.tabBarController.tabBarsetSelectedImageTintColor:[UIColor greenColor]];
ios8中如下设置:
self.tabBar.tintColor=[UIColor greenColor];
消除tabbar边框
在appdelegate的程序启动处:
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
[[UITabBar appearance] setBackgroundImage:[[UIImage alloc]init]];
设置tabbar item原始图标与原始选中图标,而不是系统自动填充的颜色
// 拿到 TabBar 在