0

在我的应用程序中,我在导航栏的右键单击按钮上启动了一个 modalViewController。此 modalViewController 与导航栏重叠。我尝试设置它的框架,但它保持不变。即使 modalViewController 仍然存在,我也想显示导航栏。

编辑:我在导航控制器的右栏按钮按下时调用以下方法。视图显示正确,但位置不对。

-(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];
}

提前谢谢。

4

1 回答 1

1

你需要它是同一个导航栏吗?

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

于 2010-09-07T12:10:18.157 回答