title: How to resize the UITabBarItem?
body: <p>My code here:</p>
  
  <pre><code>for (NSInteger i = 1; i&lt;= 4 ; i ++) {
  
      UIViewController *VC = self.viewControllers[i-1];
      UIImage *itemImage = [[UIImage imageNamed:[self getTabBarItemImageNameFromIndex:i selected:NO]] imageWithRenderingMode:UIImageRenderingModeAutomatic];
  
      UIImage *itemImageSelected = [[UIImage imageNamed:[self getTabBarItemImageNameFromIndex:i selected:YES]]imageWithRenderingMode:UIImageRenderingModeAutomatic];
  
      UITabBarItem *item = [[UITabBarItem alloc]initWithTitle:[self getTabBarItemTitleWithIndex:i] image:itemImage selectedImage:itemImageSelected];
  
      item.tag = i-1;
      VC.tabBarItem = item;
  }
  </code></pre>
  
  <p>First I run :
  <a href="https://i.stack.imgur.com/LIwsN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LIwsN.png" alt="enter image description here"></a></p>
  
  <p>I want to shrink the UITabBarItem size, the original size of picture is 36 × 36 pixels.</p>
  
  <p>Then I add these code: </p>
  
  <pre><code>       item.imageInsets = UIEdgeInsetsMake(3, 3, 3, 3);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LeiJz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LeiJz.png" alt="enter image description here"></a></p>
  
  <p>It does well,but when I press the TabBarItem the size of item was changed
  <a href="https://i.stack.imgur.com/QcMIm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QcMIm.png" alt="enter image description here"></a></p>
  
  <p>I know the issue is about the setting of imageInsets, but I don't know how to resize the TabBarItem without to set imageInsets.</p>