views:

54

answers:

1

Hi all,

In my application, I'm launching a modalViewController on rightbarbutton click of navigationbar. This modalViewController overlaps the navigationbar. I tried setting its frame but it remained the same. I want to display navigationbar even if modalViewController is still there.

EDIT: I call the following method on navigationcontroller's rightbarbutton press. The view appears properly but the position is not right.

-(void)showViewForPosts{

self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@"DISMISS"
                                 style: UIBarButtonItemStyleBordered
                                target:self
                                action:@selector(dismissViewCOntroller)];

displayController = [[UIViewController alloc]initWithNibName:nil bundle:nil];
displayController.view.frame = CGRectMake(0.0, 150.0, 320, 436);
displayController.view.backgroundColor = [UIColor blueColor];

//I'M ADDING DIFFERENT VIEWS HERE

[self presentModalViewController:displayController animated:YES];
}

Thanx in advance.

+1  A: 

Do you need it to be the same navigation bar?

In my app, there is another NavigationController for the modal view flow, ie going from a modal view to another. This feels more consistent to me, since 'modal' means taking (temporary) exclusive access to screen and inputs, whereas navigation on iPhone is stacking views.

jv42
Thanx for trying to help.. I did the same actually.. This post is quite older.. +1 for nice explanation..
neha