0
votes

I am very new to iOS. Here is what I have implemented:

I am doing a app in iOS 4 (as it's required). I have used navigationController as root controller through app delegate.

Then from my first loaded view, I push to another viewcontroller which has implemented tabbar in it, say MyTabBarViewController.

MyTabBarViewController has say 3 viewControllers associated with it via:

MyTabBarController.viewControllers = [NSArray arrayWithObjects:yxzcontroller,abcController,nil];

Now I want to show the navigation bar for only the 2nd and 3rd viewcontroller and also want to customise it.

So how do I hide the navigationbar from first viewcontroller(yxzcontroller) of MyTabBarController and customise for others?

I tried:

[self.navigationController.navigationBar setHidden:YES];

I also tried:

[self.parentViewController.navigationController setNavigationBarHidden:YES animated:YES];

but these don't work from yxzcontroller.

To summarise:

I have NavController as root controller --> Normal ViewController -- > ViewController (with TabBarController)

TabBarController---> yxzcontroller,abcController

1

1 Answers

1
votes

I don't think you are supposed to have a tab bar controller in a nav controller. You can probably do it, it might get weird though.

You should be able to call

[self.navigationController setNavigationBarHidden:YES animated:NO];

in the ViewDidLoad of the views who's nav bar you want hidden.