Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS8/Swift: Tab Bar Item getting smaller on click

Tags:

I just encountered a weird bug when giving insets to my Tab Bar images.

When I click the image in the built version, the image will apply the inset every time i click it -> so if you click it 3x it will basically disappear - if you click another Tab Bar Item it reappears again.

Obviously this only happens if you set left/right inset - not if you only set top/bottom

Anyone knows how to fix this without resizing the actual Tab Bar Image externally?

like image 357
longbow Avatar asked Mar 15 '15 17:03

longbow


1 Answers

Steps to resolve the issue:

  1. Select the tab bar item of the problematic ViewControllers in IB
  2. Go to Size Inspector section (on the right)

Ensure your image insets are balanced If you give 5px inset to top then balance with a -5px inset to bottom If you give 5px inset to left then balance with a -5px inset to right

like image 127
Y0gita Avatar answered Sep 17 '22 22:09

Y0gita