Dhaval H. Nena
Dhaval H. Nena

Reputation: 4130

getting two navigation bar when clicking tabbar more button

Having one main navigation controller in whole application and also one main tabbarcontroller , problem is that when i click om 'more' tab of tabbarcontroller at that time it's showing two navigation bars

to solve this problem i tried to hide my main navigation controllers navigationbar using following code :

        self.tabbar.navigationController.navigationBarHidden =YES;

but doing this gives me unexpected result in the form of half navigationbar with half black background.

if any one knows the solution then please help me. thanks in advance.

Upvotes: 2

Views: 1881

Answers (3)

Jignesh Mayani
Jignesh Mayani

Reputation: 7193

make viewController With separate UINavigationController,

put this code in Appdelegate

ViewController *a = [[ViewController alloc] initWithNibName:@"a" bundle:nil];
ViewController *b= [[CreateMeetingViewController alloc] initWithNibName:@"b" bundle:nil];
ViewController *c = [[SettingsViewController alloc] initWithNibName:@"c" bundle:nil];


UINavigationController *nav_1 = [[UINavigationController alloc] initWithRootViewController:a];
UINavigationController *nav_2 = [[UINavigationController alloc] initWithRootViewController:b];
UINavigationController *nav_3 = [[UINavigationController alloc] initWithRootViewController:c];

MainTabBar = [[UITabBarController alloc] init];
MainTabBar.delegate = self;
[MainTabBar setViewControllers:[NSArray arrayWithObjects:nav_1,nav_2,nav_3,nil]];
MainTabBar.view.frame=self.view.frame;

[self.view addSubview:MainTabBar.view];

Upvotes: 2

Parvendra Singh
Parvendra Singh

Reputation: 985

Write in viewWillAppear, i hope it will be helpful for you

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

Upvotes: 0

Gurpreet
Gurpreet

Reputation: 181

You can check your .Xib you check the option Top Bar this should be 'None' in the identity inspector.

Upvotes: 0

Related Questions