Reputation: 55
Ever since I updated Xcode my icons are not aligned on my UITabBar. The two end icons appear higher vertically than the two in the middle. I have not modified this bar whatsoever besides the icons. I thought it may be the icon size, but when I take the left icon and apply it to the 2nd image, the alignment is still off.
Upvotes: 3
Views: 2545
Reputation: 109
I had the same problem when creating uitabbar items programmatically. I could vertically aligned the icons by giving empty string to titles.
let tabarItem = UITabBarItem()
tabBarItem.image = UIImage(named: "imgTabIcon")
tabBarItem.title = ""
Upvotes: 1
Reputation: 665
I had this problem going from Xcode 10 to 11 the issue turned out to be I had a whitespace character for the Bar Item's title. Just click the 'Title' textfield and delete the text if something is there, to make sure there isn't whitespace character.
Upvotes: 2
Reputation: 1
I had the same problem, with an older iOS app created in 2017 (3 years old). I just deleted the tabbar, recreated it in Storyboard, reassigned all the tab bar items, and that fixed it. I suspect there is a problem with the older conversion of storyboards with uitabbars.
Upvotes: 0
Reputation: 480
Take fix size images its due to space in image. Tabbar always shows the same size which we provide it. Check your icon images there must be space in images.
Upvotes: 1