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.
-
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?DonMag– DonMag2020年08月25日 17:09:07 +00:00Commented 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.Bar Malka– Bar Malka2020年08月26日 04:44:55 +00:00Commented Aug 26, 2020 at 4:44
1 Answer 1
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 = ""
Comments
Explore related questions
See similar questions with these tags.