Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image on UITabBar gets squished

Tags:

ios

uitabbar

Hey I am using a custom sized UITabBar with extra large images.

I add the images to the tab bar item like this:

UITabBar *tabBar = self.tabBar;
    UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
    [tabBarItem1 setImage:[UIImage imageNamed:@"image"]];
    [tabBarItem1 setImageInsets:UIEdgeInsetsMake(0, 0, 20, 0)];

Also because the images are larger I want them to hover more in the middle of the tab bar, so I add the inset.

My issue is when I program the inset and then click on the button, the button squishes in on its self. It maintains its width, but its height squishes in on its self. I of course don't want this to happen, but I can't seem to find out whats going on.

Thanks, Krtko

-Note for Mods Please lock this thread

-Note for people answering my question. I appreciate your help but it was a known bug at the time, so please stop answering this question. Thank you

like image 212
Krtko Avatar asked Nov 28 '22 21:11

Krtko


1 Answers

Are you seeing this on iOS 7 only?

7.1 seemed to introduce a bug with tab bar image insets. If you continually tap or hold the tab, it grows or shrinks depending on the insets. If you tap on another tab, the tab bar image goes back to normal right?

like image 87
Inertiatic Avatar answered Dec 13 '22 20:12

Inertiatic