0

I need to subclass a UITabBar and increase its size.

I made it with code

 -(CGSize)sizeThatFits:(CGSize)size
{
   CGSize sizeThatFits = [super sizeThatFits:size];
   sizeThatFits.height = kTabBarHeight;
   return sizeThatFits;

But this stretches it. How can I increase it without stretching? I need some clear area.

1 Answer 1

1

I faced this issue and I was able to solve it. You have to add following code to your subclass of UITabBarController class.

- (void)viewWillLayoutSubviews
{ 
    CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar
    tabFrame.size.height = 80;
    tabFrame.origin.y = self.view.frame.size.height - 80;
    self.tabBar.frame = tabFrame;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.