PDA

View Full Version : Navigation Controller + Tab Bar Controller needed




siva.d
Oct 29, 2008, 07:36 AM
I started doing iphone application development from one week.

I have probelm :

1) I need a welcome view controller initially without any "Navigation controller" and "TabBar Controller".
I have a button in this viewController. so when i click on that button it should goto login view.

2)In login view also i don't need "Navigation controller" and "TabBar Controller".
Here when i click login button, it should goto main view.

3)In main we i need navaigationa controller as well as Tabbar Controller.

If you have any sample code please send me.

welcomeViewControler --> loginViewControler --->mainViewController.

I want to learn how it works with IB.

Thanks in advance



jnic
Oct 30, 2008, 09:22 AM
Take a look at the UICatalog code sample (http://developer.apple.com/iphone/library/samplecode/UICatalog/index.html) for examples of the various IB components and switching between views.

siva.d
Nov 2, 2008, 10:58 PM
Thanks for your replay

i seen examples which can give NavController and TabController Form appDelegate using IB.

But i need Those Controllers(NavBar and TabBar) in a ViewController. In the same viewController, i want TableView also.

siva.d
Nov 3, 2008, 12:31 AM
Hi,

i have created a TabBarControler Using IB.

I have assigned two nib files for two tabs of that TabBarController.

I am calling that TabBarController nib file like this(in a button click action)

-(IBAction) level3View:(id)sender{
UITabBarController *tabBar1=[[UITabBarController alloc] initWithNibName:@"tabBar1" bundle:nil];
WorkspaceViewController *workspaces=[[WorkspaceViewController alloc] initWithNibName:@"Workspace" bundle:nil];
ContactsViewController *contacts=[[ContactsViewController alloc] initWithNibName:@"Contacts" bundle:nil];
tabBar1.viewControllers=[NSArray arrayWithObjects:workspaces,contacts, nil];
[self setMyTabBar:tabBar1];
[[self navigationController] pushViewController:myTabBar animated:YES];
}

It is working without any error.

Tabbar is visible, But Tabs are not visible on new view(displaying empty tab bar):confused:

How to get those tabs visible.

please....

siva.d
Nov 5, 2008, 04:34 AM
Hi,

-(IBAction) level3Viewid)sender{
UITabBarController *tabBar1=[[UITabBarController alloc] init];
WorkspaceViewController *workspaces=[[WorkspaceViewController alloc] initWithNibName:@"Workspace" bundle:nil];
ContactsViewController *contacts=[[ContactsViewController alloc] initWithNibName:@"Contacts" bundle:nil];
tabBar1.viewControllers=[NSArray arrayWithObjects:workspaces,contacts, nil];
[self setMyTabBar:tabBar1];
[[self navigationController] pushViewController:myTabBar animated:YES];
}

My tab bar is displaying its tabs now.

its working fine.:D

but problem is my navigation controller is not working.:confused:

jnic
Nov 5, 2008, 06:42 AM
Rather than creating the layout programmatically, it's probably simpler to use Interface Builder to add a Navigation Controller and Tab Bar Controller to the same view.

siva.d
Nov 11, 2008, 03:04 AM
Thank you jnic,

Ya i am trying to that using Interface builder only.

Do u have any sample application like that.

Can u send that to me

Thank you once again

siva.d
Nov 14, 2008, 05:17 AM
I did this using Interface builder.

its working fine.

i want to share the code.

But i dont know how to attach the zip file here.

can any one help me?

thanks

Mili8Mac
Jul 16, 2009, 02:47 AM
Hi Siva.d

I am new to iphone and I am facing the same issue.. From your post it is pretty clear that you have achieved your requirement long back.
I would be very thankful if you please share as to how did you achieve the solution?

mraheel
Jul 16, 2009, 03:05 AM
I dont understand whats your main navigation control. The NavBar? or Tab Bar?
If its the tabBar? then you should add the tabbarcontroller first to your Mainview.xib. then add NavigationController to a tabbar.

You look like a beginner, I'm a little ahead of that, My advice is, to use IB effectively and where you can. In most circumstances, it does its Job. IB is there for a reason. To make our lives easier. Its hard to understand at first. But play around with it alot more and watch videos and tutorials.

You should choose ONE control as your apps backbone so to speak. Like a TabBarController can be your app's backbone. There can be views here and there.. without it.

Mili8Mac
Jul 16, 2009, 06:11 AM
hello

my requirement is - my application's first screen is a login screen which doesnot require any tabbar. once logged in I have a Home screen which is basically a table view in a navigation controller. I need the tabbar from this screen onwards. How do I achieve it..If I take Tab Controller as the backbone I will be required to
1.first hide the tab bar in the first screen
2.second remove the first tab(basically resembling the first screen) from the tab bar in rest of the screens.

Please someone help me to as to how can I achieve this?

Thanks in advance

dejo
Jul 16, 2009, 10:03 AM
Please someone help me to as to how can I achieve this?
Make the Tab Bar Controller your main view. (This is always good advice). Then make your login screen a modal view.

Mili8Mac
Jul 17, 2009, 01:03 AM
Make the Tab Bar Controller your main view. (This is always good advice). Then make your login screen a modal view.

Hi dijo,

Thank you so much for responding.. As per your suggestion I looked into the concept of model view. But I am unable to find some relevant example to implement the same. can you please help me on this?

dejo
Jul 17, 2009, 09:58 AM
Check out this tutorial (http://adeem.me/blog/2009/06/22/creating-splash-screen-tutorial-for-iphone/), perhaps.

macfa
Aug 25, 2009, 05:35 PM
Hi All,
I am new to the iPhone development, gone through various docs and tutorials and worked on simple first app.

Now I need to develop a app for real.
Reading through this thread I am in need of a good example for
welcomeViewControler --> loginViewControler --->mainViewController

similar to siva.d original posts.

I have created a login view, and can create a separate table view.
Problem I am having is making them flow
Open Login View,
Display Main tab view controller.

Anyone have points to good sample good/tutorials showing this multiple views and transitions from one to another.

Thanks in Advance

paddoum
Nov 27, 2009, 02:37 PM
You'll find the source of a project implementing a NavBar plus TabBar programmatically at the following address http://www.myfirstiphoneapplication.com (http://www.myfirstiphoneapplication.com/2009/11/tabbar-together-with-a-navbar-programmatically/)

GS1971
Apr 10, 2010, 12:40 AM
hihi Siva
Please can you forward your sample code to me for reference? I am looking for the solution as well, it will be hiiiiiiiiiiiiiiiighly appreciated to get an effort from you !!

AbhishekApple
Aug 23, 2010, 01:03 AM
I started doing iphone application development from one week.

I have probelm :

1) I need a welcome view controller initially without any "Navigation controller" and "TabBar Controller".
I have a button in this viewController. so when i click on that button it should goto login view.

2)In login view also i don't need "Navigation controller" and "TabBar Controller".
Here when i click login button, it should goto main view.

3)In main we i need navaigationa controller as well as Tabbar Controller.

If you have any sample code please send me.

welcomeViewControler --> loginViewControler --->mainViewController.

I want to learn how it works with IB.

Thanks in advance

Hi Shiv i am new to iphone n facing the same problem found ur quote on google pls will u exp with exmple hw to solve the abv problem..
Can't we use tabbar and navigationbar in view instead of tabbar controller and navigation controller in window