0

I have a UITabBarController with 5 buttons. For some reason, the icons are not aligned vertically, and I can't figure out why. I checked Google and StackOverflow for a good solution, nothing worked from there yet.

I also tried to change all icons to be the same, and they still have the same gaps.

All icons are vectors (PDF)

Attached screenshots from the User Interface inspector and the app.

tab2 tab1

asked Aug 25, 2020 at 16:07
2
  • Is it possible whatever code you're using for the "big center" tab is causing the issue? If you create a new tab bar project, add your icon pdfs, and try it with the defaults do the icons align? Commented Aug 25, 2020 at 17:09
  • I actually have tried to remove just the center button (but still takes another room for another icon, so still 5 spots) and it still looked the same. I tried to add a fixed size icons and still unaligned. Commented Aug 26, 2020 at 4:44

1 Answer 1

0

I found a solution to this issue, and it's not about the icons.

All you need to do, is to define EMPTY STRING to the item's title.

Before:

tabBarItem.title = nil

After:

tabBarItem.title = ""
answered Aug 26, 2020 at 5:01
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.