设置背景:
- [_tabBar setBackgroundImage:[UIImage imageNamed:@"bg_tabbar"]];
设置某个Item选中的效果:
- _tabBar.selectionIndicatorImage = [UIImage imageNamed:@"bar_item_selected"];//设置选中效果图片
设置UITabBarItem文字颜色
- [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] }
- forState:UIControlStateNormal];
- [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] }
- forState:UIControlStateHighlighted];
设置UITabBarItem未选中与选中时的图片:
- [_hotTabItem setFinishedSelectedImage:[UIImage imageNamed:@"1_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"1"]];
- [_searchTabItem setFinishedSelectedImage:[UIImage imageNamed:@"2_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"2"]];
- [_userTabItem setFinishedSelectedImage:[UIImage imageNamed:@"3_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"3"]];