title: iOS Change frame of UITabBarButton in UITabBar
body: <p>In my app I have a <code>UITabBarController</code> in which I give custom selected/unselected images in my <code>AppDelegate</code> as follows:</p>
  
  <pre><code>UIImage *selectedImage = [UIImage imageNamed:@"home-tab-selected"];
  UIImage *unselectedImage = [UIImage imageNamed:@"home-tab"];
  UITabBar *tabBar = tabController.tabBar;
  UITabBarItem *item1 = [tabBar.items objectAtIndex:0];
  [item1 setFinishedSelectedImage:selectedImage withFinishedUnselectedImage:unselectedImage];
  </code></pre>
  
  <p>The images I have are 100x100, much larger than the normal tab bar items. All works well, and my images are placed nicely and look great. </p>
  
  <p>The issue I am having is that the frame of the underlaying <code>UITabBarButton</code> remains 76x48, leaving only a small portion of my tabs 'touchable'. (Image below with a border around the frame)</p>
  
  <p><img src="https://i.stack.imgur.com/1ki7i.png" alt="frame smaller than tab image"></p>
  
  <p>To attempt to fix this, in my subcalssed <code>UITabBarController</code> <code>viewDidLoad</code>, I go through each <code>UITabBarButton</code>, and set the frame as follows:</p>
  
  <pre><code>for (UIView* subView in self.tabBar.subviews)
  {
      if ([subView isKindOfClass:NSClassFromString(@"UITabBarButton")])
      {
  
          [subView setFrame:CGRectMake(subView.frame.origin.x, subView.frame.origin.y, 100, 100)];
  
  
      }
  }
  </code></pre>
  
  <p>After I do that, I log the frames and they do change-- BUT the frame never changes in my tab bar-- I still only see and can touch in the smaller red box.</p>
  
  <p>Is this because Apple does not allow you to change these frames or am I doing something wrong here?</p>
  
  <p>Any help apperciated! Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>In the end I just ended up making my tab images smaller. I found a height of 70px still picks up most touches.</p>