第一步:获取tabbar
UITabBar *tabBar = self.tabBarController.tabBar;
第二步:获取tababr的所有选项
UITabBarItem *item = [tabBar.items objectAtIndex:0];
第三步:设置图片,选择要设置的tabbaritem
NSString *homePath = [[NSBundle mainBundle] pathForResource:@"btn_home_highlight@2x" ofType:@"png"];
if(item.tag == 1)
{
item.selectedImage = [UIImage imageWithContentsOfFile:homePath];
}
这个就搞定了