Asked 7 years ago
28 Oct 2016
Views 1250
QuickIos

QuickIos posted

is it possible to use UITabBarItem without image ?

using code belowed

override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
 
       let prefiledetail = ProfileViewController()
         
        let tabOneBarItem = UITabBarItem(title: "Profile", image:  UIImage() , selectedImage:   UIImage() )
        // Create Tab  Review
       let tabTwo = ReViewController( )
        let tabTwoBarItem2 = UITabBarItem(title: "Reviews", image:   UIImage() , selectedImage:  UIImage())
          
        self.viewControllers = [tabOne, tabTwo]
    
    }


tabBar show with tiny text and text above space remained empty.so i thinking that space for images what i don't want and i need only big text , so i tried something other

        let tabTwoBarItem2 = UITabBarItem(title: "Reviews", image:   nil, selectedImage:  UIImage())



i tried setting image to nil, but text is small and aligned to bottom of UITabBarItem.

so is that possible to use UITabBarItem without image only text



Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

you can make image with name of text and use it with UIImage , its good solution
Post Answer