0

I have this code to display colored images in tabbar.

_itemOneNavigationController.tabBarItem.image = [[UIImage imageNamed:@"tabbar-trophy"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_itemOneNavigationControllerr.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar-trophy-selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

This works well on iPhone5 & 4. However, on iPhone6 & 6+, images are appearing but do not occupy the entire tabBarItem. They are appearing centered.

dr.calix
  • 667
  • 8
  • 21

1 Answers1

0

Try UITabBarItem setFinishedSelectedImage:withFinishedUnselectedImage:

UIImage *unselected = [[UIImage imageNamed:@"tabbar-trophy"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *selected = [[UIImage imageNamed:@"tabbar-trophy-selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

[_itemOneNavigationController.tabBarItem setFinishedSelectedImage:selected withFinishedUnselectedImage:unselected];
iscrz
  • 26
  • 2