HurkNburkS
HurkNburkS

Reputation: 5510

UINavigationController inside UIViewController that is inside a UINavigationConroller

I have a Navigation application that has a view controller in it.. I am now trying to load another NavigationController into that ViewController however I am experiencing problems..

I am trying to do it programmatically because I am not sure how to do it in InterfaceBuilder however the new navigation controller displayes weird.. like it thinks there is a infobar above it.. so has a white gap..

As you can see here.

enter image description here

This is all I am doing to get this ^ current look....

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    UINavigationController *newNav = [[UINavigationController alloc] init];
    [self.view addSubview:newNav.view];

    newNav.navigationItem.title=@"Navigation Controller Example";
}

Any help would be greatly appreciated.

Upvotes: 1

Views: 1229

Answers (1)

Dzy
Dzy

Reputation: 153

As you say,you just have an Navi-based App, so if you want to add another NavigationController in your application ,you should hide the new NavigationController's bar .Following is the code.

[newNav setNavigationBarHidden:YES animated:YES]; 

Upvotes: 2

Related Questions