2010-06-29 72 views
0

在我的应用程序中,我在右键菜单上点击导航栏启动了一个modalViewController。这个modalViewController重叠导航栏。我试图设置它的框架,但它保持不变。我想要显示导航栏,即使modalViewController仍然存在。ModalViewController甚至在设置其框架之后重叠导航栏iphone

编辑:我在navigationcontroller的rightbarbutton新闻上调用以下方法。视图正确显示,但位置不正确。

-(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提前。

+0

没有代码,没有线索; ;-) – Eiko 2010-06-29 07:53:00

+0

请检查我编辑的代码。 – neha 2010-06-29 09:03:01

回答

1

你需要它是相同的导航栏吗?

在我的应用程序中,还有另一个用于模态视图流的NavigationController,即从模态视图到另一个模态视图。这对我来说更加一致,因为'模态'意味着对屏幕和输入进行(临时)独占访问,而iPhone上的导航则是堆叠视图。

+0

Thanx试图帮助..我做了同样的事实..这篇文章是相当老.. +1为好的解释.. – neha 2010-09-08 05:41:45