ModalViewController overlaps navigationbar even after setting its frame iphone
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.
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.
精彩评论