Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pankaj21c

macrumors newbie
Original poster
Apr 15, 2009
14
0
Hi,
I have to create a Tab Bar Application with two tabs but that tabbar
should be displayed to first screen(when app launch) only, once one of the tab bar button is pressed then the navigation based application has to be started.

Please give me some idea how to do since i new to this. If u can attach some example and any website where i can get these all stuff then please do it.

Regards
Pankaj
 
I'm not sure I entirely understand your question but I think you are asking how to implement both a tab bar controller and navigation controller at the same time.

If I were you, I would start a new tab bar controller project and then add the UINavigationController to the view you require it on (i.e. initialise it in the view controller attached to one of the tabs where you require it). You can do this both programmatically or using Interface Builder.

To do it programmatically, you just need to call something like the following:

Code:
UINavigationController *myNavigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];  // or whatever view controller you require to be first on the stack.
In the above example, the tab bar controller would take presidence over the navigation controller(s) but this is the behaviour you would normally require.
 
TabBar+Navigation

I'm not sure I entirely understand your question but I think you are asking how to implement both a tab bar controller and navigation controller at the same time.

If I were you, I would start a new tab bar controller project and then add the UINavigationController to the view you require it on (i.e. initialise it in the view controller attached to one of the tabs where you require it). You can do this both programmatically or using Interface Builder.

To do it programmatically, you just need to call something like the following:

Code:
UINavigationController *myNavigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];  // or whatever view controller you require to be first on the stack.
In the above example, the tab bar controller would take presidence over the navigation controller(s) but this is the behaviour you would normally require.
Hi,
Actually what i want is when the application launches there should be just splash image with two buttons(Register and Next) if next/register is presses there should be table+navigation. I have done it using navigation based application but i think it is useless to have navigation bar on the first page since i dont want to go back to the first page so what i want is to have both buttons on the botton and after pressing one of them Table+navigation
should appear, i have done this using ToolBar on my viewController
but i m not able to do with TabBar controller.
Plz tell me which application i should go with or what i have used is the
correct way.

Thanks for helping
 
In that case you should not use a tab bar. Apple's user interface guidelines explicitly say that a tab bar should be used as a paradigm for radio buttons where always one is selected. Besides struggling to see how this would work in practice with a tab bar, your app will likely be rejected by Apple if you implement it this way.

It sounds like what you want to have is a modal view with two buttons that displays on top of your first view (table view + navigation controller).

How you implement the user interface for the buttons is up to you - you could either have a navigation bar at the top with your buttons to dismiss on it, or alternatively on a toolbar on the bottom of the modal view, or if you have space you could just provide buttons in the main frame. Then, when you click it, the modal view would dismiss off the bottom of the screen to reveal your main view underneath.
 
Depending on the other content of this splash page, a UIAlertView or UIActionSheet may be sufficient for what you're trying to achieve.
 
In that case you should not use a tab bar. Apple's user interface guidelines explicitly say that a tab bar should be used as a paradigm for radio buttons where always one is selected. Besides struggling to see how this would work in practice with a tab bar, your app will likely be rejected by Apple if you implement it this way.

It sounds like what you want to have is a modal view with two buttons that displays on top of your first view (table view + navigation controller).

How you implement the user interface for the buttons is up to you - you could either have a navigation bar at the top with your buttons to dismiss on it, or alternatively on a toolbar on the bottom of the modal view, or if you have space you could just provide buttons in the main frame. Then, when you click it, the modal view would dismiss off the bottom of the screen to reveal your main view underneath.
Hi,
Thanks for reply.
I have done this using ViewController based app with a ToolBar having two buttons, then i have put two navigation Controller(for the two buttons) on the mainWindow.Xib. First i have add ViewController to the main window and when either button of the toolBar is pressed, i am releasing the
view controller and adding corresponding navigation controller to the main
window as a subview.
Please tell me this approach is correct or bcz i m a very new to iPhone development and no one is there to guide.
Plz reply as soon as possible.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.