I have a UITableViewController
and a TabBar
inside of the TableView
and I want to be able to display that TabBar
at the bottom of the IPhone screen and not at the bottom of the Table Cells
So The TabBar
will always remain fixed to the screen but at the bottom.
Not sure how I can accomplish this within a Table View Controller
?
The TabBar
is a navigation bar to be more exact. To leave the table and go to different controllers
.
Okay so I just realized I was just pulling a TabBar
into the controller. So I went to the Navigation Controller
and set the bottom bar in. So that takes me to my next question, how do I display that button bar in certain view controllers
and not show it in others.
Your use of UITabBar
is not correct for what you are trying to accomplish. The standard use of a UITabBar
is in the context of a UITabBarController
.
Here is a sample use of tab bars.
1) Create a UITabBarController
and set it as the rootViewController
of your window
in your AppDelegate
.
2) Assign the viewControllers
property of the tab bar controller to be an array of the view controllers you want to be able to switch between (which you must also create).
3) You will need to do some additional research if you want to style the different aspects of the tab bar. Some things are styled by accessing the tabBar
property of the UITabBarController
directly. Other things (like individual tab icons and titles) are set by using the tabBarItem
property of each view controller.
4) If you want to encapsulate all of this logic into one place and potentially change some of the default logic, subclass UITabBarController
.
edit: your question has changed a bit and I'm not sure this answer is valid anymore. That said, it sounds like you are also misusing the UINavigationBar
as this is not really its intended purpose (perhaps you meant to use a UIToolBar
?)