开发者

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 cel开发者_JAVA技巧l is selected.

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

Replace UITabBar with UIToolBar

And when you select a table view cell:

Replace UITabBar 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?


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]


Why not: detailController.hidesBottomBarWhenPushed = YES;

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


Although @Hector Ramos answer is correct one.

But beside this one can do the same thing in other way too.

Just make the Object of DelegateClass file & use this:

[DelegateClassObj.window addSubview:toolbar];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜