Change UITabBarController - iphone

I want to ask if it is possible to change UITabBarController to another UITabBarController as you navigate through your app?
Like... I have 3 tabs, the one is a navigationcontroller. When I navigate through the tab with the UINavigationController, I will have 2 other tabs.
I just want to know if it's possible and a hint.
Thanks.

As commented by Bourne that's not a good idea, not easily possible (you'd have to remove the tabbarcontroller then create another and remove that and re-add the first one when you wanted to go back) plus it would confuse users and Apple likely wouldn't allow it in the app store.
It would be better to have a toolbar inside a tabbar.

Related

How to create tab like buttons in iPad to switch between views

I want create a view with a line of UIButtons at the top of the view. While user selects each button he/she should be able to switch between the views.
I tried it by adding the view one above the other in .xib and setting the view.hidden = NO and view.hidden = YES. But I know this is not the proper way to implement this.
Can you experts please suggest a good way to implement this scenario?
You can use UITabBar. But this will not give you two lines of tabs, I guess. If you are satisfied with one line of tab and other tab will be hidden like the old iPod application in iPhone, then UITabBar is an option.

Multiple UITabBarControllers

I want to make an App that has multiple UITabBarControllers. The idea is that when the app launches, the user has 3 options, and based on what option he chooses decides which UITabBarController is displayed. (i have kinda got this bit working atm). BUT i want the user to be able to go back to the beginning and choose another option, again displaying a different UITabBarController. - this is where i am stuck
can anyone help me? or suggest the best way to handle this.
Thanks
Sam
I would choose a UINavigationController to be the rootViewController of the window object.
The first UIViewController shows the options for the three tab bars. Depending on the selection you can push a specific UITabbarController to the UINavigationController. May this idea help?

iOS Custom Menu (Navigation Controller? )

I have an app planned out that needs to have a custom menu throughout the application. Its not a toolbar or anything like that so i don't think a regular UINavigationController or a UITabBarController will do the job.
What would be the best approach to creating this custom menu that appears in all views? I thought of just creating a view with the custom menu and alloc it for each view but it seems like a bit of an overkill. Extending UINavigationController might also be an option, but I'm not sure.
Would love to hear your opinions.
Thank you! :)
Shai.
The UINavigationController and the UITabBarController are pretty much always the best way to go because they have view and memory management built in. Here's what you can do:
Create a subclass of UITabBarController that hides the tab bar. See the last post on this page: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4091-uitabbarcontroller-hidden-uitabbar.html Make this UITabBarController accessible on a singleton object.
Create a view for your menu and some IBActions corresponding to the menu buttons.
When a menu button is pressed, you can manually switch the tabs of the uitabbarcontroller as follows: tabBarController.selectedIndex = x;
I agree with ade. I think a popover controller added to a shared class would fit best to the iOS style (I'd put it in AppDelegate in order to have reference to it from anywhere and to avoid creating multiple instances and using only one which you will keep displaying / hiding whenever you wish to see the menu)
I can think of two options: 1. Subclass UINavigationController, hide the standard UINavigationBar's view and create your own view and put it on top of it (ugly and who knows what the results will end up like). 2. Add the menu as a subview of UIWindow so it stays on top of everything throughout the app.
I think the best way is to create a custom tool bar and use it across the app. Subclassing UINavBar is another option but not recommended by Apple so I would not go there.
I'd look into using a popover style menu such as WEPopover

How to hide tab of the tabBarController?

I want to create a Tab in the TabBarController but i don't want to show that on the tabBar...i mean it should be there but invisible...
like I have 5 tabs in my tabBarController and I want that my fifth Tab only is invisible...
is this possible??
There's no way to hide an individual tab. You could give it a blank icon, I suppose, but you'd still see the space where the tab is. If you had more than 5 tabs, you could arrange for this invisible tab to be on the More... tab item, so it wouldn't be immediately visible but the user could access it.
If you don't want the user to be able to access it, one has to wonder why you want to include it in the tab bar controller in the first place. Rememeber: when you find yourself fighting against the framework like this, there's usually a much better way to do what you're trying to do.
Not really—the tab-bar controller is pretty specifically implemented so that any view controller it manages can be accessed from the tab-bar UI somehow, be it on the bar itself or in the “More” section. What are you trying to accomplish?

Show ToolBar over TabBar

In my app I would like to replace the TabBar with a ToolBar under certain conditions, similar to what happens in the Photos App when a user places it in selections mode (A toolbar with share copy, etc, buttons appear over the tab bar). How can I achieve this please?
This can be achieved by creating a new toolbar, assigning it an appropriate frame and adding it to self.tabBarController.view
I'm assuming your root view controller is a UITabBarController. Sometimes using the canned "Root" UIViewControllers is more of a hindrance than a help, especially if you want a highly custom look that does not fit into the paradigm of what the canned controllers offer. There's no reason you have to use them -- you could write your own, and do your own transition between your sub-UIViewController views onto the screen. You can use the UITabBar without the UITabBarController in your own custom UIViewController subclass, then you don't end up fighting the behavior of UITabBarController. Writing your own root ViewController can be very instructive as well -- you learn about all the things a root ViewController must do to manage the sub-ViewControllers.