UITabBarItem Change Image Height and Width

Viewed 12863

I have a UITabBarItem without a title and only an image. I was wondering how I can change the image size so it can take up the whole UITabBarItem.

I searched all over the internet but found nothing.

I tried:

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main_Storyboard" bundle:nil];
UITabBarController *tabBarController = [storyBoard instantiateViewControllerWithIdentifier:@"tab"];
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];

tabBarItem1.imageInsets = UIEdgeInsetsMake(0, -10, -6, -10);

but nothing changed.

Thank you!

1 Answers
Related