Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace UITabBar with UIToolBar

I have an application with UITabBarController with a UINavigationController subview, which holds a table view. I want to be able to switch out the UITabBarController with a UIToolbar for a specific view controller when a cell is selected.

Here's an example from some other application, which reacts the same way:

Initial view with UITabBarController and UINavigationController

And when you select a table view cell:

Detailed view with UIToolbar

The detailed view controller (second screen) needs to replace the parent UITabBarController with an UIToolbar. Does anyone know how I can do this?

like image 896
rebellion Avatar asked Sep 18 '10 20:09

rebellion


2 Answers

From UIToolBar on top of UITabBar? :

You may be able to add the toolbar as a subview of your key window:

[[[UIApplication sharedApplication] keyWindow] addSubview:toolbarView]
like image 153
Héctor Ramos Avatar answered Oct 03 '22 04:10

Héctor Ramos


Why not: detailController.hidesBottomBarWhenPushed = YES;

before pushing to the navigationstack? Your DetailController's view can have the toolbar added via code or IB.

like image 41
cweinberger Avatar answered Oct 03 '22 05:10

cweinberger