How to add a TabBar to NavigationController based iPhone app

前端 未结 6 467
花落未央
花落未央 2020-12-24 03:51

I have a simple NavigationController based app. The main window shows a TableView and selecting an item loads a sub-view. I used Interface Builder for UI views.

Now

6条回答
  •  时光说笑
    2020-12-24 04:20

    I do this in a couple of my apps. The trick to adding a tab bar to a navigationController based app is to NOT use a TabBarController. Add a Tab Bar to the view, make the view controller for that view a TabBarDelegate, and respond to user selections on the tab bar in the code of the view controller.

    I use Tab Bars to add additional views to the Tab Bar's view as sub-views, to reload a table view with different datasets, to reload a UIPickerView, etc.

提交回复
热议问题