Search code examples
iosswift3uitabbarcontrolleruitabbar

Display only text without image for UITabBarItem?


I want to display only title for tabbar item without image. Is it possible? When I tried setting

let tabItem = UITabBarItem()
tabItem.title = "Tab1"
tabItem.selectedImage = nil
tabItem.image = nil
tabViewController?.tabBarItem = tabItem

I'm just getting a blank space which is tapable, but no title or image.


Solution

  • simplest way is remove the images from the tab bar and set the custom offset vertical.as shown in the image. or else follow the link that TJ3n priveded remove the images in the UITabBarItem and aligned vertically the title.

    enter image description here