Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the title on the tab bar item with navigation controller

I have a tab bar item on navigation controller connected with tab bar controller and i want to delete the title in swift

Tab Bar Controller > Navigation Controller > View Controller

Tab Bar Item

Flow of the program

The application start with the tab bar controller with five tabs each one of these tabs are working fine i mean as hiding the title under the tab bar item but the tab in the image only have the problem of not been hidden and for that the application is also working on this tab okay if the user is logged out and the Viewcontroller in the image is showing but if the user is sign in the title on the tab bar item is showing so if there is away that i can hide the title programmatically

like image 389
SALEH Avatar asked Apr 12 '16 00:04

SALEH


People also ask

How do you hide the tab bar when a view controller is shown?

If you don't want that behavior, you should set hidesBottomBarWhenPushed to true where applicable. This will hide the tab bar along with any toolbars you had showing, but only when a view controller is pushed onto the navigation stack. This allows you to show the tab bar at first, then hide it when you need more room.

How do I add a tab bar to my navigation controller?

To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.

How do I add a Viewcontroller to the tab bar controller in storyboard?

To add the new View Controller to the Tab Bar Controller, right-click the Tab Bar Controller and drag it to the new View Controller. Select Relationship Segue. Now, the Tab Bar Controller has the third item and Relationship “view controllers” to “View Controller”.

What is tab on a controller?

The user of your app can switch between view controllers by tapping one of the tabs in the tab bar at the bottom of the screen. A tab bar is often used to switch between different, but comparable view controllers.


1 Answers

As others have suggested, you can either go to Interface Builder and erase the Title on the Bar Item or you can do it programatically.

This is enough as long as you don't set the title property for the UIViewController that your tab links to. If you want to set a title for your view controller and avoid it showing up as the bar item title, use navigationItem.title = "My Title" instead of title = "My Title".

like image 112
Peter Avatar answered Nov 14 '22 17:11

Peter